diff --git a/.github/workflows/cross-cloud-tests.yaml b/.github/workflows/cross-cloud-tests.yaml index a6dbf5191..148f93f43 100644 --- a/.github/workflows/cross-cloud-tests.yaml +++ b/.github/workflows/cross-cloud-tests.yaml @@ -5,16 +5,15 @@ on: - cron: '0 0 * * *' # Nightly run at midnight workflow_dispatch: # Manual trigger - permissions: id-token: write - contents: read + contents: read jobs: - build-and-push-images: + build-and-push-images: permissions: id-token: write - contents: read + contents: read name: Build and Push Docker Images runs-on: warp-ubuntu-latest-x64-8x-spot steps: @@ -24,14 +23,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Configure AWS credentials from OIDC uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::061717858829:role/ecr-pull-push-role aws-region: us-east-1 - - name: Login to Amazon ECR run: | aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws @@ -60,7 +57,7 @@ jobs: test: permissions: id-token: write - contents: read + contents: read needs: build-and-push-images runs-on: warp-ubuntu-latest-x64-8x-spot strategy: @@ -69,7 +66,6 @@ jobs: test-scenario: [multi-apps, helm-chart] # Add or remove scenarios as needed steps: - - name: Configure AWS credentials from OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -92,7 +88,6 @@ jobs: echo "TF_VAR_test_scenario=${{ matrix.test-scenario }}" >> $GITHUB_ENV echo "TF_VAR_run_id=${{ github.run_id }}" >> $GITHUB_ENV - - name: Configure Cloud Provider run: | if [ "${{ matrix.cloud-provider }}" = "aks" ]; then @@ -140,8 +135,7 @@ jobs: fi - name: Initialize OpenTofu - run: tofu -chdir=$TF_DIR init - + run: tofu -chdir=$TF_DIR init - name: Plan OpenTofu run: tofu -chdir=$TF_DIR plan @@ -166,7 +160,7 @@ jobs: - name: Verify cluster Access run: | - kubectl get nodes || exit 1 + kubectl get nodes || exit 1 - name: Install Chainsaw uses: kyverno/action-install-chainsaw@v0.2.8 @@ -179,7 +173,7 @@ jobs: - name: Install FE # this is used for cypress tests which are not run in every scenario - if: matrix.test-scenario == 'multi-apps' || matrix.test-scenario == 'helm-chart' || matrix.test-scenario == 'fe-synthetic' + if: matrix.test-scenario == 'multi-apps' || matrix.test-scenario == 'helm-chart' run: | cd frontend/webapp yarn install @@ -189,18 +183,18 @@ jobs: # This uses in chainsaw to split e2e tests from cross cloud tests export MODE=cross-cloud-tests - + # This uses in chainsaw to verify the odigos version is equal to the commit version export COMMIT_HASH=${{ github.sha }} chainsaw test tests/e2e/${{ matrix.test-scenario }} - + - name: Run diagnose command if: always() run: | ./cli/odigos diagnose continue-on-error: true - + - name: Upload run details artifact if: always() uses: actions/upload-artifact@v4 @@ -237,4 +231,3 @@ jobs: GITHUB_RUN_ID: ${{ github.run_id }} run: | curl -X POST -H 'Content-type: application/json' --data '{"blocks":[{"type":"section","text":{"type":"mrkdwn","text":"*SUCCESS*: Providers tests succeed > `${{ matrix.cloud-provider }} - ${{ matrix.test-scenario }}`"}},{"type":"section","fields":[{"type":"mrkdwn","text":"*Link:*\n"},{"type":"mrkdwn","text":"*Tag:*\n`${{ steps.extract_tag.outputs.tag }}`"}]}]}' ${{ env.SLACK_WEBHOOK_URL }} - diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index dbaaba21e..3d99e82ff 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -12,7 +12,6 @@ concurrency: cancel-in-progress: true jobs: - build-cli: runs-on: ubuntu-latest steps: @@ -22,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "~1.22" + go-version: '~1.22' check-latest: true cache: true cache-dependency-path: | @@ -57,7 +56,7 @@ jobs: path: odigos-images.tar kubernetes-test: - needs: + needs: - build-odigos-images - build-cli runs-on: warp-ubuntu-latest-x64-8x-spot @@ -65,22 +64,21 @@ jobs: fail-fast: false matrix: kube-version: - - "1.20.15" - - "1.23" - - "1.30" + - '1.20.15' + - '1.23' + - '1.30' test-scenario: - - "multi-apps" - - "helm-chart" - - "fe-synthetic" - - "cli-upgrade" - - "workload-lifecycle" + - 'multi-apps' + - 'helm-chart' + - 'cli-upgrade' + - 'workload-lifecycle' include: - - kube-version: "1.20.15" - kind-image: "kindest/node:v1.20.15@sha256:a32bf55309294120616886b5338f95dd98a2f7231519c7dedcec32ba29699394" - - kube-version: "1.23" - kind-image: "kindest/node:v1.23.17@sha256:14d0a9a892b943866d7e6be119a06871291c517d279aedb816a4b4bc0ec0a5b3" - - kube-version: "1.30" - kind-image: "kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e" + - kube-version: '1.20.15' + kind-image: 'kindest/node:v1.20.15@sha256:a32bf55309294120616886b5338f95dd98a2f7231519c7dedcec32ba29699394' + - kube-version: '1.23' + kind-image: 'kindest/node:v1.23.17@sha256:14d0a9a892b943866d7e6be119a06871291c517d279aedb816a4b4bc0ec0a5b3' + - kube-version: '1.30' + kind-image: 'kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e' steps: - name: Checkout uses: actions/checkout@v4 @@ -88,7 +86,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "~1.22" + go-version: '~1.22' check-latest: true cache: true cache-dependency-path: | @@ -106,12 +104,12 @@ jobs: uses: helm/kind-action@v1.10.0 with: node_image: ${{ matrix.kind-image }} - version: "v0.23.0" + version: 'v0.23.0' cluster_name: kind - name: Install FE # this is used for cypress tests which are not run in every scenario - if: matrix.test-scenario == 'multi-apps' || matrix.test-scenario == 'helm-chart' || matrix.test-scenario == 'fe-synthetic' + if: matrix.test-scenario == 'multi-apps' || matrix.test-scenario == 'helm-chart' run: | cd frontend/webapp yarn install diff --git a/.vscode/launch.json b/.vscode/launch.json index 81f463cac..a3ba143a6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,84 +1,69 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Remote Odiglet", - "type": "go", - "request": "attach", - "mode": "remote", - "debugAdapter": "legacy", - "port": 2345, - "host": "127.0.0.1", - "remotePath": "" - }, - { - "name": "instrumentor local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/instrumentor", - "cwd": "${workspaceFolder}/instrumentor", - "env": { - "LOCAL_MUTATING_WEBHOOK_CERT_DIR": "${workspaceFolder}/serving-certs" - } - }, - { - "name": "frontend", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/frontend", - "cwd": "${workspaceFolder}/frontend", - "args": ["--port", "8085", "--address", "0.0.0.0"] - }, - { - "name": "autoscaler local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/autoscaler", - "cwd": "${workspaceFolder}/autoscaler", - "env": { - "ODIGOS_VERSION": "v1.0.90" - } - }, - { - "name": "scheduler local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/scheduler", - "cwd": "${workspaceFolder}/scheduler" - }, - { - "name": "cli uninstall", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/cli", - "cwd": "${workspaceFolder}/cli", - "args": ["uninstall", "--yes"], - "buildFlags": "-tags=embed_manifests" - }, - { - "name": "cli install", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/cli", - "cwd": "${workspaceFolder}/cli", - "args": ["install"], - "buildFlags": "-tags=embed_manifests" - }, - { - "name": "cli describe", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/cli", - "cwd": "${workspaceFolder}/cli", - "args": ["describe source deployment membership"], - "buildFlags": "-tags=embed_manifests" - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Remote Odiglet", + "type": "go", + "request": "attach", + "mode": "remote", + "debugAdapter": "legacy", + "port": 2345, + "host": "127.0.0.1", + "remotePath": "" + }, + { + "name": "instrumentor local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/instrumentor", + "cwd": "${workspaceFolder}/instrumentor" + }, + { + "name": "frontend", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/frontend", + "cwd": "${workspaceFolder}/frontend", + "args": ["--port", "8085", "--address", "0.0.0.0"] + }, + { + "name": "gql-playground", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/frontend/main.go", + "cwd": "${workspaceFolder}/frontend" + }, + { + "name": "autoscaler local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/autoscaler", + "cwd": "${workspaceFolder}/autoscaler", + "env": { + "ODIGOS_VERSION": "v1.0.90" + } + }, + { + "name": "scheduler local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/scheduler", + "cwd": "${workspaceFolder}/scheduler" + }, + { + "name": "cli uninstall", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/cli", + "cwd": "${workspaceFolder}/cli", + "args": ["uninstall", "--yes"], + "buildFlags": "-tags=embed_manifests" + } + ] +} diff --git a/cli/cmd/resources/ui.go b/cli/cmd/resources/ui.go index 65c3edb76..7af7877bf 100644 --- a/cli/cmd/resources/ui.go +++ b/cli/cmd/resources/ui.go @@ -308,6 +308,10 @@ func NewUIService(ns string) *corev1.Service { Name: "ui", Port: 3000, }, + { + Name: "beta-ui", + Port: 3001, + }, { Name: "otlp", Port: consts.OTLPPort, diff --git a/cli/cmd/ui.go b/cli/cmd/ui.go index f7a987062..963aea9cc 100644 --- a/cli/cmd/ui.go +++ b/cli/cmd/ui.go @@ -26,7 +26,8 @@ import ( ) const ( - defaultPort = 3000 + defaultPort = 3000 + betaDefaultPort = 3001 ) // uiCmd represents the ui command @@ -49,22 +50,29 @@ var uiCmd = &cobra.Command{ } } + betaFlag, _ := cmd.Flags().GetBool("beta") + localPort := cmd.Flag("port").Value.String() + clusterPort := defaultPort + + if betaFlag { + clusterPort = betaDefaultPort + } + + localAddress := cmd.Flag("address").Value.String() uiPod, err := findOdigosUIPod(client, ctx, ns) if err != nil { fmt.Printf("\033[31mERROR\033[0m Cannot find odigos-ui pod: %s\n", err) os.Exit(1) } - localPort := cmd.Flag("port").Value.String() - localAddress := cmd.Flag("address").Value.String() - if err := portForwardWithContext(ctx, uiPod, client, localPort, localAddress); err != nil { + if err := portForwardWithContext(ctx, uiPod, client, localPort, localAddress, clusterPort); err != nil { fmt.Printf("\033[31mERROR\033[0m Cannot start port-forward: %s\n", err) os.Exit(1) } }, } -func portForwardWithContext(ctx context.Context, uiPod *corev1.Pod, client *kube.Client, localPort string, localAddress string) error { +func portForwardWithContext(ctx context.Context, uiPod *corev1.Pod, client *kube.Client, localPort string, localAddress string, clusterPort int) error { stopChannel := make(chan struct{}, 1) readyChannel := make(chan struct{}) signals := make(chan os.Signal, 1) @@ -94,7 +102,7 @@ func portForwardWithContext(ctx context.Context, uiPod *corev1.Pod, client *kube Name(uiPod.Name). SubResource("portforward") - return forwardPorts("POST", req.URL(), client.Config, stopChannel, readyChannel, localPort, localAddress) + return forwardPorts("POST", req.URL(), client.Config, stopChannel, readyChannel, localPort, localAddress, clusterPort) } func createDialer(method string, url *url.URL, cfg *rest.Config) (httpstream.Dialer, error) { @@ -114,13 +122,13 @@ func createDialer(method string, url *url.URL, cfg *rest.Config) (httpstream.Dia return dialer, nil } -func forwardPorts(method string, url *url.URL, cfg *rest.Config, stopCh chan struct{}, readyCh chan struct{}, localPort string, localAddress string) error { +func forwardPorts(method string, url *url.URL, cfg *rest.Config, stopCh chan struct{}, readyCh chan struct{}, localPort string, localAddress string, clusterPort int) error { dialer, err := createDialer(method, url, cfg) if err != nil { return err } - port := fmt.Sprintf("%s:%d", localPort, defaultPort) + port := fmt.Sprintf("%s:%d", localPort, clusterPort) fw, err := portforward.NewOnAddresses(dialer, []string{localAddress}, []string{port}, stopCh, readyCh, nil, os.Stderr) @@ -151,9 +159,9 @@ func findOdigosUIPod(client *kube.Client, ctx context.Context, ns string) (*core return &pods.Items[0], nil } - func init() { rootCmd.AddCommand(uiCmd) - uiCmd.Flags().Int("port", defaultPort, "port to listen on") + uiCmd.Flags().Int("port", defaultPort, "Port to listen on") uiCmd.Flags().String("address", "localhost", "Address to listen on") + uiCmd.Flags().Bool("beta", false, "use new experimental UI") } diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6bd07074c..06d2fe775 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,20 +1,19 @@ -FROM --platform=$BUILDPLATFORM node:20.2.0 AS deps +FROM --platform=$BUILDPLATFORM node:20.9.0 AS deps WORKDIR /app COPY frontend/webapp/package.json frontend/webapp/yarn.lock ./ -RUN --mount=type=cache,target=/usr/local/share/.cache/yarn/v6 \ - yarn install --frozen-lockfile +RUN yarn install -FROM --platform=$BUILDPLATFORM node:20.2.0 AS builder +FROM --platform=$BUILDPLATFORM node:20.9.0 AS builder WORKDIR /webapp COPY --from=deps /app/node_modules ./node_modules -COPY frontend//webapp . +COPY frontend/webapp . RUN yarn build - FROM --platform=$BUILDPLATFORM golang:1.22 AS backend WORKDIR /app COPY . . COPY --from=builder /webapp/out frontend/webapp/out +COPY --from=builder /webapp/dep-out frontend/webapp/dep-out WORKDIR /app/frontend ARG TARGETARCH RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o odigos-ui @@ -23,4 +22,4 @@ FROM gcr.io/distroless/static:nonroot WORKDIR /app COPY --from=backend /app/frontend/odigos-ui . USER 65532:65532 -ENTRYPOINT ["/app/odigos-ui", "--address", "0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["/app/odigos-ui", "--address", "0.0.0.0"] diff --git a/frontend/Makefile b/frontend/Makefile new file mode 100644 index 000000000..6dfe36f60 --- /dev/null +++ b/frontend/Makefile @@ -0,0 +1,2 @@ +gqlgen: + go get github.com/99designs/gqlgen@v0.17.49 && go run github.com/99designs/gqlgen generate \ No newline at end of file diff --git a/frontend/go.mod b/frontend/go.mod index 5a5a36606..617ea6275 100644 --- a/frontend/go.mod +++ b/frontend/go.mod @@ -3,6 +3,7 @@ module github.com/odigos-io/odigos/frontend go 1.22.0 require ( + github.com/99designs/gqlgen v0.17.49 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.1 github.com/go-logr/logr v1.4.2 @@ -11,6 +12,7 @@ require ( github.com/odigos-io/odigos/destinations v0.0.0-20240223090638-df3328a088bc github.com/odigos-io/odigos/k8sutils v0.0.0 github.com/stretchr/testify v1.9.0 + github.com/vektah/gqlparser/v2 v2.5.16 go.opentelemetry.io/collector/component v0.106.1 go.opentelemetry.io/collector/confmap v0.106.1 go.opentelemetry.io/collector/exporter v0.106.0 @@ -78,6 +80,7 @@ require ( ) require ( + github.com/agnivade/levenshtein v1.1.1 // indirect github.com/bytedance/sonic v1.9.2 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -101,6 +104,8 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -109,11 +114,13 @@ require ( 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/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect @@ -150,4 +157,5 @@ replace ( github.com/odigos-io/odigos/common => ../common github.com/odigos-io/odigos/destinations => ../destinations github.com/odigos-io/odigos/k8sutils => ../k8sutils + ) diff --git a/frontend/go.sum b/frontend/go.sum index c481a4420..a6ed52ff1 100644 --- a/frontend/go.sum +++ b/frontend/go.sum @@ -1,3 +1,15 @@ +github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= +github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= +github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= +github.com/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/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= @@ -15,6 +27,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= @@ -91,10 +105,14 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2 github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 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/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +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/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -136,6 +154,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 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/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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -174,6 +194,10 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +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/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -197,6 +221,8 @@ github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6 github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +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/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -358,8 +384,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/frontend/gqlgen.yml b/frontend/gqlgen.yml new file mode 100644 index 000000000..562c27730 --- /dev/null +++ b/frontend/gqlgen.yml @@ -0,0 +1,64 @@ +# Where are all the schema files located? globs are supported eg src/**/*.graphqls +schema: + - graph/*.graphqls + +# Where should the generated server code go? +exec: + filename: graph/generated.go + package: graph + +# Uncomment to enable federation +# federation: +# filename: graph/federation.go +# package: graph + +# Where should any generated models go? +model: + filename: graph/model/models_gen.go + package: model + +# Where should the resolver implementations go? +resolver: + layout: follow-schema + dir: graph + package: graph + filename_template: '{name}.resolvers.go' + +# 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/odigos-io/odigos/frontend/graph/model' + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + + ComputePlatform: + fields: + k8sActualNamespace: + resolver: true + k8sActualNamespaces: + resolver: true + k8sActualSource: + resolver: true + destinations: + resolver: true + actions: + resolver: true + k8sActualSources: + resolver: true + instrumentationRules: + resolver: true + K8sActualNamespace: + fields: + k8sActualSources: + resolver: true diff --git a/frontend/graph/conversions.go b/frontend/graph/conversions.go new file mode 100644 index 000000000..71b7df4fa --- /dev/null +++ b/frontend/graph/conversions.go @@ -0,0 +1,150 @@ +package graph + +import ( + "time" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + gqlmodel "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/services" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func k8sKindToGql(k8sResourceKind string) gqlmodel.K8sResourceKind { + switch k8sResourceKind { + case "Deployment": + return gqlmodel.K8sResourceKindDeployment + case "StatefulSet": + return gqlmodel.K8sResourceKindStatefulSet + case "DaemonSet": + return gqlmodel.K8sResourceKindDaemonSet + } + return "" +} + +func k8sConditionStatusToGql(status v1.ConditionStatus) gqlmodel.ConditionStatus { + switch status { + case v1.ConditionTrue: + return gqlmodel.ConditionStatusTrue + case v1.ConditionFalse: + return gqlmodel.ConditionStatusFalse + case v1.ConditionUnknown: + return gqlmodel.ConditionStatusUnknown + } + return gqlmodel.ConditionStatusUnknown + +} + +func k8sLastTransitionTimeToGql(t v1.Time) *string { + if t.IsZero() { + return nil + } + str := t.UTC().Format(time.RFC3339) + return &str +} + +func k8sThinSourceToGql(k8sSource *services.ThinSource) *gqlmodel.K8sActualSource { + + hasInstrumentedApplication := k8sSource.IaDetails != nil + + var gqlIaDetails *gqlmodel.InstrumentedApplicationDetails + if hasInstrumentedApplication { + gqlIaDetails = &gqlmodel.InstrumentedApplicationDetails{ + Containers: make([]*gqlmodel.SourceContainerRuntimeDetails, len(k8sSource.IaDetails.Languages)), + Conditions: make([]*gqlmodel.Condition, len(k8sSource.IaDetails.Conditions)), + } + + for i, lang := range k8sSource.IaDetails.Languages { + gqlIaDetails.Containers[i] = &gqlmodel.SourceContainerRuntimeDetails{ + ContainerName: lang.ContainerName, + Language: lang.Language, + } + } + + for i, cond := range k8sSource.IaDetails.Conditions { + gqlIaDetails.Conditions[i] = &gqlmodel.Condition{ + Type: cond.Type, + Status: k8sConditionStatusToGql(cond.Status), + Reason: &cond.Reason, + LastTransitionTime: k8sLastTransitionTimeToGql(cond.LastTransitionTime), + Message: &cond.Message, + } + } + } + + return &gqlmodel.K8sActualSource{ + Namespace: k8sSource.Namespace, + Kind: k8sKindToGql(k8sSource.Kind), + Name: k8sSource.Name, + NumberOfInstances: &k8sSource.NumberOfRunningInstances, + InstrumentedApplicationDetails: gqlIaDetails, + } +} + +func k8sSourceToGql(k8sSource *services.Source) *gqlmodel.K8sActualSource { + baseSource := k8sThinSourceToGql(&k8sSource.ThinSource) + return &gqlmodel.K8sActualSource{ + Namespace: baseSource.Namespace, + Kind: baseSource.Kind, + Name: baseSource.Name, + NumberOfInstances: baseSource.NumberOfInstances, + InstrumentedApplicationDetails: baseSource.InstrumentedApplicationDetails, + ServiceName: &k8sSource.ReportedName, + } +} + +func instrumentedApplicationToActualSource(instrumentedApp v1alpha1.InstrumentedApplication) *gqlmodel.K8sActualSource { + // Map the container runtime details + var containers []*gqlmodel.SourceContainerRuntimeDetails + for _, container := range instrumentedApp.Spec.RuntimeDetails { + containers = append(containers, &gqlmodel.SourceContainerRuntimeDetails{ + ContainerName: container.ContainerName, + Language: string(container.Language), + }) + } + + // Map the conditions of the application + var conditions []*gqlmodel.Condition + for _, condition := range instrumentedApp.Status.Conditions { + conditions = append(conditions, &gqlmodel.Condition{ + Type: condition.Type, + Status: k8sConditionStatusToGql(condition.Status), + Reason: &condition.Reason, + LastTransitionTime: k8sLastTransitionTimeToGql(condition.LastTransitionTime), + Message: &condition.Message, + }) + } + + // Map the options for instrumentation libraries + var instrumentationOptions []*gqlmodel.InstrumentedApplicationDetails + for _, option := range instrumentedApp.Spec.Options { + for _, libOptions := range option.InstrumentationLibraries { + var libraries []*gqlmodel.InstrumentationOption + for _, configOption := range libOptions.Options { + libraries = append(libraries, &gqlmodel.InstrumentationOption{ + OptionKey: configOption.OptionKey, + SpanKind: gqlmodel.SpanKind(configOption.SpanKind), + }) + } + + instrumentationOptions = append(instrumentationOptions, &gqlmodel.InstrumentedApplicationDetails{ + Containers: containers, + Conditions: conditions, + }) + } + } + + // Return the converted K8sActualSource object + return &gqlmodel.K8sActualSource{ + Namespace: instrumentedApp.Namespace, + Kind: k8sKindToGql(instrumentedApp.OwnerReferences[0].Kind), + Name: instrumentedApp.OwnerReferences[0].Name, + ServiceName: &instrumentedApp.Name, + NumberOfInstances: nil, + AutoInstrumented: instrumentedApp.Spec.Options != nil, + AutoInstrumentedDecision: "", + InstrumentedApplicationDetails: &gqlmodel.InstrumentedApplicationDetails{ + Containers: containers, + Conditions: conditions, + }, + } +} diff --git a/frontend/graph/generated.go b/frontend/graph/generated.go new file mode 100644 index 000000000..84cbb2e83 --- /dev/null +++ b/frontend/graph/generated.go @@ -0,0 +1,18434 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package graph + +import ( + "bytes" + "context" + "embed" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/odigos-io/odigos/frontend/graph/model" + 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 { + ComputePlatform() ComputePlatformResolver + Destination() DestinationResolver + K8sActualNamespace() K8sActualNamespaceResolver + Mutation() MutationResolver + Query() QueryResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + AddClusterInfoAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + ClusterInfo struct { + AttributeName func(childComplexity int) int + AttributeStringValue func(childComplexity int) int + } + + ComputePlatform struct { + Actions func(childComplexity int) int + ComputePlatformType func(childComplexity int) int + Destinations func(childComplexity int) int + InstrumentationRules func(childComplexity int) int + K8sActualNamespace func(childComplexity int, name string) int + K8sActualNamespaces func(childComplexity int) int + K8sActualSource func(childComplexity int, name *string, namespace *string, kind *string) int + K8sActualSources func(childComplexity int) int + } + + Condition struct { + LastTransitionTime func(childComplexity int) int + Message func(childComplexity int) int + Reason func(childComplexity int) int + Status func(childComplexity int) int + Type func(childComplexity int) int + } + + DbQueryPayloadCollection struct { + DropPartialPayloads func(childComplexity int) int + MaxPayloadLength func(childComplexity int) int + } + + DeleteAttribute struct { + AttributeName func(childComplexity int) int + } + + DeleteAttributeAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + Destination struct { + Conditions func(childComplexity int) int + DestinationType func(childComplexity int) int + ExportedSignals func(childComplexity int) int + Fields func(childComplexity int) int + Id func(childComplexity int) int + Name func(childComplexity int) int + Type func(childComplexity int) int + } + + DestinationDetails struct { + Fields func(childComplexity int) int + Type func(childComplexity int) int + URLString func(childComplexity int) int + } + + DestinationTypesCategoryItem struct { + DisplayName func(childComplexity int) int + ImageUrl func(childComplexity int) int + SupportedSignals func(childComplexity int) int + TestConnectionSupported func(childComplexity int) int + Type func(childComplexity int) int + } + + DestinationsCategory struct { + Items func(childComplexity int) int + Name func(childComplexity int) int + } + + ErrorSamplerAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + ExportedSignals struct { + Logs func(childComplexity int) int + Metrics func(childComplexity int) int + Traces func(childComplexity int) int + } + + Field struct { + ComponentProperties func(childComplexity int) int + ComponentType func(childComplexity int) int + DisplayName func(childComplexity int) int + InitialValue func(childComplexity int) int + Name func(childComplexity int) int + ThumbnailURL func(childComplexity int) int + VideoURL func(childComplexity int) int + } + + GetConfigResponse struct { + Installation func(childComplexity int) int + } + + GetDestinationDetailsResponse struct { + Fields func(childComplexity int) int + } + + GetDestinationTypesResponse struct { + Categories func(childComplexity int) int + } + + HttpPayloadCollection struct { + DropPartialPayloads func(childComplexity int) int + MaxPayloadLength func(childComplexity int) int + MimeTypes func(childComplexity int) int + } + + IcaInstanceResponse struct { + ID func(childComplexity int) int + Spec func(childComplexity int) int + Type func(childComplexity int) int + } + + InstrumentationLibrary struct { + LibraryName func(childComplexity int) int + Options func(childComplexity int) int + } + + InstrumentationLibraryGlobalId struct { + Language func(childComplexity int) int + Name func(childComplexity int) int + SpanKind func(childComplexity int) int + } + + InstrumentationOption struct { + OptionKey func(childComplexity int) int + SpanKind func(childComplexity int) int + } + + InstrumentationRule struct { + Disabled func(childComplexity int) int + InstrumentationLibraries func(childComplexity int) int + Notes func(childComplexity int) int + PayloadCollection func(childComplexity int) int + RuleID func(childComplexity int) int + RuleName func(childComplexity int) int + Workloads func(childComplexity int) int + } + + InstrumentedApplicationDetails struct { + Conditions func(childComplexity int) int + Containers func(childComplexity int) int + InstrumentationOptions func(childComplexity int) int + } + + K8sActualNamespace struct { + InstrumentationLabelEnabled func(childComplexity int) int + K8sActualSources func(childComplexity int, instrumentationLabeled *bool) int + Name func(childComplexity int) int + } + + K8sActualSource struct { + AutoInstrumented func(childComplexity int) int + AutoInstrumentedDecision func(childComplexity int) int + InstrumentedApplicationDetails func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + NumberOfInstances func(childComplexity int) int + ReportedName func(childComplexity int) int + ServiceName func(childComplexity int) int + } + + LatencySamplerAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + MessagingPayloadCollection struct { + DropPartialPayloads func(childComplexity int) int + MaxPayloadLength func(childComplexity int) int + } + + Mutation struct { + CreateAction func(childComplexity int, action model.ActionInput) int + CreateInstrumentationRule func(childComplexity int, instrumentationRule model.InstrumentationRuleInput) int + CreateNewDestination func(childComplexity int, destination model.DestinationInput) int + DeleteAction func(childComplexity int, id string, actionType string) int + DeleteDestination func(childComplexity int, id string) int + DeleteInstrumentationRule func(childComplexity int, ruleID string) int + PersistK8sNamespace func(childComplexity int, namespace model.PersistNamespaceItemInput) int + PersistK8sSources func(childComplexity int, namespace string, sources []*model.PersistNamespaceSourceInput) int + TestConnectionForDestination func(childComplexity int, destination model.DestinationInput) int + UpdateAction func(childComplexity int, id string, action model.ActionInput) int + UpdateDestination func(childComplexity int, id string, destination model.DestinationInput) int + UpdateInstrumentationRule func(childComplexity int, ruleID string, instrumentationRule model.InstrumentationRuleInput) int + UpdateK8sActualSource func(childComplexity int, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) int + } + + ObservabilitySignalSupport struct { + Supported func(childComplexity int) int + } + + OverviewMetricsResponse struct { + Destinations func(childComplexity int) int + Sources func(childComplexity int) int + } + + PayloadCollection struct { + DbQuery func(childComplexity int) int + HTTPRequest func(childComplexity int) int + HTTPResponse func(childComplexity int) int + Messaging func(childComplexity int) int + } + + PiiMaskingAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + PodWorkload struct { + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } + + ProbabilisticSamplerAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + Query struct { + ComputePlatform func(childComplexity int) int + Config func(childComplexity int) int + DestinationTypeDetails func(childComplexity int, typeArg string) int + DestinationTypes func(childComplexity int) int + GetOverviewMetrics func(childComplexity int) int + PotentialDestinations func(childComplexity int) int + } + + RenameAttributeAction struct { + Details func(childComplexity int) int + Disable func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Signals func(childComplexity int) int + Type func(childComplexity int) int + } + + SingleDestinationMetricsResponse struct { + ID func(childComplexity int) int + Throughput func(childComplexity int) int + TotalDataSent func(childComplexity int) int + } + + SingleSourceMetricsResponse struct { + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + Throughput func(childComplexity int) int + TotalDataSent func(childComplexity int) int + } + + SourceContainerRuntimeDetails struct { + ContainerName func(childComplexity int) int + Language func(childComplexity int) int + } + + SupportedSignals struct { + Logs func(childComplexity int) int + Metrics func(childComplexity int) int + Traces func(childComplexity int) int + } + + TestConnectionResponse struct { + DestinationType func(childComplexity int) int + Message func(childComplexity int) int + Reason func(childComplexity int) int + StatusCode func(childComplexity int) int + Succeeded func(childComplexity int) int + } +} + +type ComputePlatformResolver interface { + K8sActualNamespace(ctx context.Context, obj *model.ComputePlatform, name string) (*model.K8sActualNamespace, error) + K8sActualNamespaces(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualNamespace, error) + K8sActualSource(ctx context.Context, obj *model.ComputePlatform, name *string, namespace *string, kind *string) (*model.K8sActualSource, error) + K8sActualSources(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualSource, error) + Destinations(ctx context.Context, obj *model.ComputePlatform) ([]*model.Destination, error) + Actions(ctx context.Context, obj *model.ComputePlatform) ([]*model.IcaInstanceResponse, error) + InstrumentationRules(ctx context.Context, obj *model.ComputePlatform) ([]*model.InstrumentationRule, error) +} +type DestinationResolver interface { + Type(ctx context.Context, obj *model.Destination) (string, error) + + Conditions(ctx context.Context, obj *model.Destination) ([]*model.Condition, error) +} +type K8sActualNamespaceResolver interface { + K8sActualSources(ctx context.Context, obj *model.K8sActualNamespace, instrumentationLabeled *bool) ([]*model.K8sActualSource, error) +} +type MutationResolver interface { + CreateNewDestination(ctx context.Context, destination model.DestinationInput) (*model.Destination, error) + PersistK8sNamespace(ctx context.Context, namespace model.PersistNamespaceItemInput) (bool, error) + PersistK8sSources(ctx context.Context, namespace string, sources []*model.PersistNamespaceSourceInput) (bool, error) + TestConnectionForDestination(ctx context.Context, destination model.DestinationInput) (*model.TestConnectionResponse, error) + UpdateK8sActualSource(ctx context.Context, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) (bool, error) + UpdateDestination(ctx context.Context, id string, destination model.DestinationInput) (*model.Destination, error) + DeleteDestination(ctx context.Context, id string) (bool, error) + CreateAction(ctx context.Context, action model.ActionInput) (model.Action, error) + UpdateAction(ctx context.Context, id string, action model.ActionInput) (model.Action, error) + DeleteAction(ctx context.Context, id string, actionType string) (bool, error) + CreateInstrumentationRule(ctx context.Context, instrumentationRule model.InstrumentationRuleInput) (*model.InstrumentationRule, error) + UpdateInstrumentationRule(ctx context.Context, ruleID string, instrumentationRule model.InstrumentationRuleInput) (*model.InstrumentationRule, error) + DeleteInstrumentationRule(ctx context.Context, ruleID string) (bool, error) +} +type QueryResolver interface { + ComputePlatform(ctx context.Context) (*model.ComputePlatform, error) + Config(ctx context.Context) (*model.GetConfigResponse, error) + DestinationTypes(ctx context.Context) (*model.GetDestinationTypesResponse, error) + DestinationTypeDetails(ctx context.Context, typeArg string) (*model.GetDestinationDetailsResponse, error) + PotentialDestinations(ctx context.Context) ([]*model.DestinationDetails, error) + GetOverviewMetrics(ctx context.Context) (*model.OverviewMetricsResponse, 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 "AddClusterInfoAction.details": + if e.complexity.AddClusterInfoAction.Details == nil { + break + } + + return e.complexity.AddClusterInfoAction.Details(childComplexity), true + + case "AddClusterInfoAction.disable": + if e.complexity.AddClusterInfoAction.Disable == nil { + break + } + + return e.complexity.AddClusterInfoAction.Disable(childComplexity), true + + case "AddClusterInfoAction.id": + if e.complexity.AddClusterInfoAction.ID == nil { + break + } + + return e.complexity.AddClusterInfoAction.ID(childComplexity), true + + case "AddClusterInfoAction.name": + if e.complexity.AddClusterInfoAction.Name == nil { + break + } + + return e.complexity.AddClusterInfoAction.Name(childComplexity), true + + case "AddClusterInfoAction.notes": + if e.complexity.AddClusterInfoAction.Notes == nil { + break + } + + return e.complexity.AddClusterInfoAction.Notes(childComplexity), true + + case "AddClusterInfoAction.signals": + if e.complexity.AddClusterInfoAction.Signals == nil { + break + } + + return e.complexity.AddClusterInfoAction.Signals(childComplexity), true + + case "AddClusterInfoAction.type": + if e.complexity.AddClusterInfoAction.Type == nil { + break + } + + return e.complexity.AddClusterInfoAction.Type(childComplexity), true + + case "ClusterInfo.attributeName": + if e.complexity.ClusterInfo.AttributeName == nil { + break + } + + return e.complexity.ClusterInfo.AttributeName(childComplexity), true + + case "ClusterInfo.attributeStringValue": + if e.complexity.ClusterInfo.AttributeStringValue == nil { + break + } + + return e.complexity.ClusterInfo.AttributeStringValue(childComplexity), true + + case "ComputePlatform.actions": + if e.complexity.ComputePlatform.Actions == nil { + break + } + + return e.complexity.ComputePlatform.Actions(childComplexity), true + + case "ComputePlatform.computePlatformType": + if e.complexity.ComputePlatform.ComputePlatformType == nil { + break + } + + return e.complexity.ComputePlatform.ComputePlatformType(childComplexity), true + + case "ComputePlatform.destinations": + if e.complexity.ComputePlatform.Destinations == nil { + break + } + + return e.complexity.ComputePlatform.Destinations(childComplexity), true + + case "ComputePlatform.instrumentationRules": + if e.complexity.ComputePlatform.InstrumentationRules == nil { + break + } + + return e.complexity.ComputePlatform.InstrumentationRules(childComplexity), true + + case "ComputePlatform.k8sActualNamespace": + if e.complexity.ComputePlatform.K8sActualNamespace == nil { + break + } + + args, err := ec.field_ComputePlatform_k8sActualNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ComputePlatform.K8sActualNamespace(childComplexity, args["name"].(string)), true + + case "ComputePlatform.k8sActualNamespaces": + if e.complexity.ComputePlatform.K8sActualNamespaces == nil { + break + } + + return e.complexity.ComputePlatform.K8sActualNamespaces(childComplexity), true + + case "ComputePlatform.k8sActualSource": + if e.complexity.ComputePlatform.K8sActualSource == nil { + break + } + + args, err := ec.field_ComputePlatform_k8sActualSource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ComputePlatform.K8sActualSource(childComplexity, args["name"].(*string), args["namespace"].(*string), args["kind"].(*string)), true + + case "ComputePlatform.k8sActualSources": + if e.complexity.ComputePlatform.K8sActualSources == nil { + break + } + + return e.complexity.ComputePlatform.K8sActualSources(childComplexity), true + + case "Condition.lastTransitionTime": + if e.complexity.Condition.LastTransitionTime == nil { + break + } + + return e.complexity.Condition.LastTransitionTime(childComplexity), true + + case "Condition.message": + if e.complexity.Condition.Message == nil { + break + } + + return e.complexity.Condition.Message(childComplexity), true + + case "Condition.reason": + if e.complexity.Condition.Reason == nil { + break + } + + return e.complexity.Condition.Reason(childComplexity), true + + case "Condition.status": + if e.complexity.Condition.Status == nil { + break + } + + return e.complexity.Condition.Status(childComplexity), true + + case "Condition.type": + if e.complexity.Condition.Type == nil { + break + } + + return e.complexity.Condition.Type(childComplexity), true + + case "DbQueryPayloadCollection.dropPartialPayloads": + if e.complexity.DbQueryPayloadCollection.DropPartialPayloads == nil { + break + } + + return e.complexity.DbQueryPayloadCollection.DropPartialPayloads(childComplexity), true + + case "DbQueryPayloadCollection.maxPayloadLength": + if e.complexity.DbQueryPayloadCollection.MaxPayloadLength == nil { + break + } + + return e.complexity.DbQueryPayloadCollection.MaxPayloadLength(childComplexity), true + + case "DeleteAttribute.attributeName": + if e.complexity.DeleteAttribute.AttributeName == nil { + break + } + + return e.complexity.DeleteAttribute.AttributeName(childComplexity), true + + case "DeleteAttributeAction.details": + if e.complexity.DeleteAttributeAction.Details == nil { + break + } + + return e.complexity.DeleteAttributeAction.Details(childComplexity), true + + case "DeleteAttributeAction.disable": + if e.complexity.DeleteAttributeAction.Disable == nil { + break + } + + return e.complexity.DeleteAttributeAction.Disable(childComplexity), true + + case "DeleteAttributeAction.id": + if e.complexity.DeleteAttributeAction.ID == nil { + break + } + + return e.complexity.DeleteAttributeAction.ID(childComplexity), true + + case "DeleteAttributeAction.name": + if e.complexity.DeleteAttributeAction.Name == nil { + break + } + + return e.complexity.DeleteAttributeAction.Name(childComplexity), true + + case "DeleteAttributeAction.notes": + if e.complexity.DeleteAttributeAction.Notes == nil { + break + } + + return e.complexity.DeleteAttributeAction.Notes(childComplexity), true + + case "DeleteAttributeAction.signals": + if e.complexity.DeleteAttributeAction.Signals == nil { + break + } + + return e.complexity.DeleteAttributeAction.Signals(childComplexity), true + + case "DeleteAttributeAction.type": + if e.complexity.DeleteAttributeAction.Type == nil { + break + } + + return e.complexity.DeleteAttributeAction.Type(childComplexity), true + + case "Destination.conditions": + if e.complexity.Destination.Conditions == nil { + break + } + + return e.complexity.Destination.Conditions(childComplexity), true + + case "Destination.destinationType": + if e.complexity.Destination.DestinationType == nil { + break + } + + return e.complexity.Destination.DestinationType(childComplexity), true + + case "Destination.exportedSignals": + if e.complexity.Destination.ExportedSignals == nil { + break + } + + return e.complexity.Destination.ExportedSignals(childComplexity), true + + case "Destination.fields": + if e.complexity.Destination.Fields == nil { + break + } + + return e.complexity.Destination.Fields(childComplexity), true + + case "Destination.id": + if e.complexity.Destination.Id == nil { + break + } + + return e.complexity.Destination.Id(childComplexity), true + + case "Destination.name": + if e.complexity.Destination.Name == nil { + break + } + + return e.complexity.Destination.Name(childComplexity), true + + case "Destination.type": + if e.complexity.Destination.Type == nil { + break + } + + return e.complexity.Destination.Type(childComplexity), true + + case "DestinationDetails.fields": + if e.complexity.DestinationDetails.Fields == nil { + break + } + + return e.complexity.DestinationDetails.Fields(childComplexity), true + + case "DestinationDetails.type": + if e.complexity.DestinationDetails.Type == nil { + break + } + + return e.complexity.DestinationDetails.Type(childComplexity), true + + case "DestinationDetails.urlString": + if e.complexity.DestinationDetails.URLString == nil { + break + } + + return e.complexity.DestinationDetails.URLString(childComplexity), true + + case "DestinationTypesCategoryItem.displayName": + if e.complexity.DestinationTypesCategoryItem.DisplayName == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.DisplayName(childComplexity), true + + case "DestinationTypesCategoryItem.imageUrl": + if e.complexity.DestinationTypesCategoryItem.ImageUrl == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.ImageUrl(childComplexity), true + + case "DestinationTypesCategoryItem.supportedSignals": + if e.complexity.DestinationTypesCategoryItem.SupportedSignals == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.SupportedSignals(childComplexity), true + + case "DestinationTypesCategoryItem.testConnectionSupported": + if e.complexity.DestinationTypesCategoryItem.TestConnectionSupported == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.TestConnectionSupported(childComplexity), true + + case "DestinationTypesCategoryItem.type": + if e.complexity.DestinationTypesCategoryItem.Type == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.Type(childComplexity), true + + case "DestinationsCategory.items": + if e.complexity.DestinationsCategory.Items == nil { + break + } + + return e.complexity.DestinationsCategory.Items(childComplexity), true + + case "DestinationsCategory.name": + if e.complexity.DestinationsCategory.Name == nil { + break + } + + return e.complexity.DestinationsCategory.Name(childComplexity), true + + case "ErrorSamplerAction.details": + if e.complexity.ErrorSamplerAction.Details == nil { + break + } + + return e.complexity.ErrorSamplerAction.Details(childComplexity), true + + case "ErrorSamplerAction.disable": + if e.complexity.ErrorSamplerAction.Disable == nil { + break + } + + return e.complexity.ErrorSamplerAction.Disable(childComplexity), true + + case "ErrorSamplerAction.id": + if e.complexity.ErrorSamplerAction.ID == nil { + break + } + + return e.complexity.ErrorSamplerAction.ID(childComplexity), true + + case "ErrorSamplerAction.name": + if e.complexity.ErrorSamplerAction.Name == nil { + break + } + + return e.complexity.ErrorSamplerAction.Name(childComplexity), true + + case "ErrorSamplerAction.notes": + if e.complexity.ErrorSamplerAction.Notes == nil { + break + } + + return e.complexity.ErrorSamplerAction.Notes(childComplexity), true + + case "ErrorSamplerAction.signals": + if e.complexity.ErrorSamplerAction.Signals == nil { + break + } + + return e.complexity.ErrorSamplerAction.Signals(childComplexity), true + + case "ErrorSamplerAction.type": + if e.complexity.ErrorSamplerAction.Type == nil { + break + } + + return e.complexity.ErrorSamplerAction.Type(childComplexity), true + + case "ExportedSignals.logs": + if e.complexity.ExportedSignals.Logs == nil { + break + } + + return e.complexity.ExportedSignals.Logs(childComplexity), true + + case "ExportedSignals.metrics": + if e.complexity.ExportedSignals.Metrics == nil { + break + } + + return e.complexity.ExportedSignals.Metrics(childComplexity), true + + case "ExportedSignals.traces": + if e.complexity.ExportedSignals.Traces == nil { + break + } + + return e.complexity.ExportedSignals.Traces(childComplexity), true + + case "Field.componentProperties": + if e.complexity.Field.ComponentProperties == nil { + break + } + + return e.complexity.Field.ComponentProperties(childComplexity), true + + case "Field.componentType": + if e.complexity.Field.ComponentType == nil { + break + } + + return e.complexity.Field.ComponentType(childComplexity), true + + case "Field.displayName": + if e.complexity.Field.DisplayName == nil { + break + } + + return e.complexity.Field.DisplayName(childComplexity), true + + case "Field.initialValue": + if e.complexity.Field.InitialValue == nil { + break + } + + return e.complexity.Field.InitialValue(childComplexity), true + + case "Field.name": + if e.complexity.Field.Name == nil { + break + } + + return e.complexity.Field.Name(childComplexity), true + + case "Field.thumbnailURL": + if e.complexity.Field.ThumbnailURL == nil { + break + } + + return e.complexity.Field.ThumbnailURL(childComplexity), true + + case "Field.videoUrl": + if e.complexity.Field.VideoURL == nil { + break + } + + return e.complexity.Field.VideoURL(childComplexity), true + + case "GetConfigResponse.installation": + if e.complexity.GetConfigResponse.Installation == nil { + break + } + + return e.complexity.GetConfigResponse.Installation(childComplexity), true + + case "GetDestinationDetailsResponse.fields": + if e.complexity.GetDestinationDetailsResponse.Fields == nil { + break + } + + return e.complexity.GetDestinationDetailsResponse.Fields(childComplexity), true + + case "GetDestinationTypesResponse.categories": + if e.complexity.GetDestinationTypesResponse.Categories == nil { + break + } + + return e.complexity.GetDestinationTypesResponse.Categories(childComplexity), true + + case "HttpPayloadCollection.dropPartialPayloads": + if e.complexity.HttpPayloadCollection.DropPartialPayloads == nil { + break + } + + return e.complexity.HttpPayloadCollection.DropPartialPayloads(childComplexity), true + + case "HttpPayloadCollection.maxPayloadLength": + if e.complexity.HttpPayloadCollection.MaxPayloadLength == nil { + break + } + + return e.complexity.HttpPayloadCollection.MaxPayloadLength(childComplexity), true + + case "HttpPayloadCollection.mimeTypes": + if e.complexity.HttpPayloadCollection.MimeTypes == nil { + break + } + + return e.complexity.HttpPayloadCollection.MimeTypes(childComplexity), true + + case "IcaInstanceResponse.id": + if e.complexity.IcaInstanceResponse.ID == nil { + break + } + + return e.complexity.IcaInstanceResponse.ID(childComplexity), true + + case "IcaInstanceResponse.spec": + if e.complexity.IcaInstanceResponse.Spec == nil { + break + } + + return e.complexity.IcaInstanceResponse.Spec(childComplexity), true + + case "IcaInstanceResponse.type": + if e.complexity.IcaInstanceResponse.Type == nil { + break + } + + return e.complexity.IcaInstanceResponse.Type(childComplexity), true + + case "InstrumentationLibrary.libraryName": + if e.complexity.InstrumentationLibrary.LibraryName == nil { + break + } + + return e.complexity.InstrumentationLibrary.LibraryName(childComplexity), true + + case "InstrumentationLibrary.options": + if e.complexity.InstrumentationLibrary.Options == nil { + break + } + + return e.complexity.InstrumentationLibrary.Options(childComplexity), true + + case "InstrumentationLibraryGlobalId.language": + if e.complexity.InstrumentationLibraryGlobalId.Language == nil { + break + } + + return e.complexity.InstrumentationLibraryGlobalId.Language(childComplexity), true + + case "InstrumentationLibraryGlobalId.name": + if e.complexity.InstrumentationLibraryGlobalId.Name == nil { + break + } + + return e.complexity.InstrumentationLibraryGlobalId.Name(childComplexity), true + + case "InstrumentationLibraryGlobalId.spanKind": + if e.complexity.InstrumentationLibraryGlobalId.SpanKind == nil { + break + } + + return e.complexity.InstrumentationLibraryGlobalId.SpanKind(childComplexity), true + + case "InstrumentationOption.optionKey": + if e.complexity.InstrumentationOption.OptionKey == nil { + break + } + + return e.complexity.InstrumentationOption.OptionKey(childComplexity), true + + case "InstrumentationOption.spanKind": + if e.complexity.InstrumentationOption.SpanKind == nil { + break + } + + return e.complexity.InstrumentationOption.SpanKind(childComplexity), true + + case "InstrumentationRule.disabled": + if e.complexity.InstrumentationRule.Disabled == nil { + break + } + + return e.complexity.InstrumentationRule.Disabled(childComplexity), true + + case "InstrumentationRule.instrumentationLibraries": + if e.complexity.InstrumentationRule.InstrumentationLibraries == nil { + break + } + + return e.complexity.InstrumentationRule.InstrumentationLibraries(childComplexity), true + + case "InstrumentationRule.notes": + if e.complexity.InstrumentationRule.Notes == nil { + break + } + + return e.complexity.InstrumentationRule.Notes(childComplexity), true + + case "InstrumentationRule.payloadCollection": + if e.complexity.InstrumentationRule.PayloadCollection == nil { + break + } + + return e.complexity.InstrumentationRule.PayloadCollection(childComplexity), true + + case "InstrumentationRule.ruleId": + if e.complexity.InstrumentationRule.RuleID == nil { + break + } + + return e.complexity.InstrumentationRule.RuleID(childComplexity), true + + case "InstrumentationRule.ruleName": + if e.complexity.InstrumentationRule.RuleName == nil { + break + } + + return e.complexity.InstrumentationRule.RuleName(childComplexity), true + + case "InstrumentationRule.workloads": + if e.complexity.InstrumentationRule.Workloads == nil { + break + } + + return e.complexity.InstrumentationRule.Workloads(childComplexity), true + + case "InstrumentedApplicationDetails.conditions": + if e.complexity.InstrumentedApplicationDetails.Conditions == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.Conditions(childComplexity), true + + case "InstrumentedApplicationDetails.containers": + if e.complexity.InstrumentedApplicationDetails.Containers == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.Containers(childComplexity), true + + case "InstrumentedApplicationDetails.instrumentationOptions": + if e.complexity.InstrumentedApplicationDetails.InstrumentationOptions == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.InstrumentationOptions(childComplexity), true + + case "K8sActualNamespace.instrumentationLabelEnabled": + if e.complexity.K8sActualNamespace.InstrumentationLabelEnabled == nil { + break + } + + return e.complexity.K8sActualNamespace.InstrumentationLabelEnabled(childComplexity), true + + case "K8sActualNamespace.k8sActualSources": + if e.complexity.K8sActualNamespace.K8sActualSources == nil { + break + } + + args, err := ec.field_K8sActualNamespace_k8sActualSources_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.K8sActualNamespace.K8sActualSources(childComplexity, args["instrumentationLabeled"].(*bool)), true + + case "K8sActualNamespace.name": + if e.complexity.K8sActualNamespace.Name == nil { + break + } + + return e.complexity.K8sActualNamespace.Name(childComplexity), true + + case "K8sActualSource.autoInstrumented": + if e.complexity.K8sActualSource.AutoInstrumented == nil { + break + } + + return e.complexity.K8sActualSource.AutoInstrumented(childComplexity), true + + case "K8sActualSource.autoInstrumentedDecision": + if e.complexity.K8sActualSource.AutoInstrumentedDecision == nil { + break + } + + return e.complexity.K8sActualSource.AutoInstrumentedDecision(childComplexity), true + + case "K8sActualSource.instrumentedApplicationDetails": + if e.complexity.K8sActualSource.InstrumentedApplicationDetails == nil { + break + } + + return e.complexity.K8sActualSource.InstrumentedApplicationDetails(childComplexity), true + + case "K8sActualSource.kind": + if e.complexity.K8sActualSource.Kind == nil { + break + } + + return e.complexity.K8sActualSource.Kind(childComplexity), true + + case "K8sActualSource.name": + if e.complexity.K8sActualSource.Name == nil { + break + } + + return e.complexity.K8sActualSource.Name(childComplexity), true + + case "K8sActualSource.namespace": + if e.complexity.K8sActualSource.Namespace == nil { + break + } + + return e.complexity.K8sActualSource.Namespace(childComplexity), true + + case "K8sActualSource.numberOfInstances": + if e.complexity.K8sActualSource.NumberOfInstances == nil { + break + } + + return e.complexity.K8sActualSource.NumberOfInstances(childComplexity), true + + case "K8sActualSource.reportedName": + if e.complexity.K8sActualSource.ReportedName == nil { + break + } + + return e.complexity.K8sActualSource.ReportedName(childComplexity), true + + case "K8sActualSource.serviceName": + if e.complexity.K8sActualSource.ServiceName == nil { + break + } + + return e.complexity.K8sActualSource.ServiceName(childComplexity), true + + case "LatencySamplerAction.details": + if e.complexity.LatencySamplerAction.Details == nil { + break + } + + return e.complexity.LatencySamplerAction.Details(childComplexity), true + + case "LatencySamplerAction.disable": + if e.complexity.LatencySamplerAction.Disable == nil { + break + } + + return e.complexity.LatencySamplerAction.Disable(childComplexity), true + + case "LatencySamplerAction.id": + if e.complexity.LatencySamplerAction.ID == nil { + break + } + + return e.complexity.LatencySamplerAction.ID(childComplexity), true + + case "LatencySamplerAction.name": + if e.complexity.LatencySamplerAction.Name == nil { + break + } + + return e.complexity.LatencySamplerAction.Name(childComplexity), true + + case "LatencySamplerAction.notes": + if e.complexity.LatencySamplerAction.Notes == nil { + break + } + + return e.complexity.LatencySamplerAction.Notes(childComplexity), true + + case "LatencySamplerAction.signals": + if e.complexity.LatencySamplerAction.Signals == nil { + break + } + + return e.complexity.LatencySamplerAction.Signals(childComplexity), true + + case "LatencySamplerAction.type": + if e.complexity.LatencySamplerAction.Type == nil { + break + } + + return e.complexity.LatencySamplerAction.Type(childComplexity), true + + case "MessagingPayloadCollection.dropPartialPayloads": + if e.complexity.MessagingPayloadCollection.DropPartialPayloads == nil { + break + } + + return e.complexity.MessagingPayloadCollection.DropPartialPayloads(childComplexity), true + + case "MessagingPayloadCollection.maxPayloadLength": + if e.complexity.MessagingPayloadCollection.MaxPayloadLength == nil { + break + } + + return e.complexity.MessagingPayloadCollection.MaxPayloadLength(childComplexity), true + + case "Mutation.createAction": + if e.complexity.Mutation.CreateAction == nil { + break + } + + args, err := ec.field_Mutation_createAction_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateAction(childComplexity, args["action"].(model.ActionInput)), true + + case "Mutation.createInstrumentationRule": + if e.complexity.Mutation.CreateInstrumentationRule == nil { + break + } + + args, err := ec.field_Mutation_createInstrumentationRule_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateInstrumentationRule(childComplexity, args["instrumentationRule"].(model.InstrumentationRuleInput)), true + + case "Mutation.createNewDestination": + if e.complexity.Mutation.CreateNewDestination == nil { + break + } + + args, err := ec.field_Mutation_createNewDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateNewDestination(childComplexity, args["destination"].(model.DestinationInput)), true + + case "Mutation.deleteAction": + if e.complexity.Mutation.DeleteAction == nil { + break + } + + args, err := ec.field_Mutation_deleteAction_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteAction(childComplexity, args["id"].(string), args["actionType"].(string)), true + + case "Mutation.deleteDestination": + if e.complexity.Mutation.DeleteDestination == nil { + break + } + + args, err := ec.field_Mutation_deleteDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteDestination(childComplexity, args["id"].(string)), true + + case "Mutation.deleteInstrumentationRule": + if e.complexity.Mutation.DeleteInstrumentationRule == nil { + break + } + + args, err := ec.field_Mutation_deleteInstrumentationRule_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteInstrumentationRule(childComplexity, args["ruleId"].(string)), true + + case "Mutation.persistK8sNamespace": + if e.complexity.Mutation.PersistK8sNamespace == nil { + break + } + + args, err := ec.field_Mutation_persistK8sNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.PersistK8sNamespace(childComplexity, args["namespace"].(model.PersistNamespaceItemInput)), true + + case "Mutation.persistK8sSources": + if e.complexity.Mutation.PersistK8sSources == nil { + break + } + + args, err := ec.field_Mutation_persistK8sSources_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.PersistK8sSources(childComplexity, args["namespace"].(string), args["sources"].([]*model.PersistNamespaceSourceInput)), true + + case "Mutation.testConnectionForDestination": + if e.complexity.Mutation.TestConnectionForDestination == nil { + break + } + + args, err := ec.field_Mutation_testConnectionForDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.TestConnectionForDestination(childComplexity, args["destination"].(model.DestinationInput)), true + + case "Mutation.updateAction": + if e.complexity.Mutation.UpdateAction == nil { + break + } + + args, err := ec.field_Mutation_updateAction_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateAction(childComplexity, args["id"].(string), args["action"].(model.ActionInput)), true + + case "Mutation.updateDestination": + if e.complexity.Mutation.UpdateDestination == nil { + break + } + + args, err := ec.field_Mutation_updateDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateDestination(childComplexity, args["id"].(string), args["destination"].(model.DestinationInput)), true + + case "Mutation.updateInstrumentationRule": + if e.complexity.Mutation.UpdateInstrumentationRule == nil { + break + } + + args, err := ec.field_Mutation_updateInstrumentationRule_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateInstrumentationRule(childComplexity, args["ruleId"].(string), args["instrumentationRule"].(model.InstrumentationRuleInput)), true + + case "Mutation.updateK8sActualSource": + if e.complexity.Mutation.UpdateK8sActualSource == nil { + break + } + + args, err := ec.field_Mutation_updateK8sActualSource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateK8sActualSource(childComplexity, args["sourceId"].(model.K8sSourceID), args["patchSourceRequest"].(model.PatchSourceRequestInput)), true + + case "ObservabilitySignalSupport.supported": + if e.complexity.ObservabilitySignalSupport.Supported == nil { + break + } + + return e.complexity.ObservabilitySignalSupport.Supported(childComplexity), true + + case "OverviewMetricsResponse.destinations": + if e.complexity.OverviewMetricsResponse.Destinations == nil { + break + } + + return e.complexity.OverviewMetricsResponse.Destinations(childComplexity), true + + case "OverviewMetricsResponse.sources": + if e.complexity.OverviewMetricsResponse.Sources == nil { + break + } + + return e.complexity.OverviewMetricsResponse.Sources(childComplexity), true + + case "PayloadCollection.dbQuery": + if e.complexity.PayloadCollection.DbQuery == nil { + break + } + + return e.complexity.PayloadCollection.DbQuery(childComplexity), true + + case "PayloadCollection.httpRequest": + if e.complexity.PayloadCollection.HTTPRequest == nil { + break + } + + return e.complexity.PayloadCollection.HTTPRequest(childComplexity), true + + case "PayloadCollection.httpResponse": + if e.complexity.PayloadCollection.HTTPResponse == nil { + break + } + + return e.complexity.PayloadCollection.HTTPResponse(childComplexity), true + + case "PayloadCollection.messaging": + if e.complexity.PayloadCollection.Messaging == nil { + break + } + + return e.complexity.PayloadCollection.Messaging(childComplexity), true + + case "PiiMaskingAction.details": + if e.complexity.PiiMaskingAction.Details == nil { + break + } + + return e.complexity.PiiMaskingAction.Details(childComplexity), true + + case "PiiMaskingAction.disable": + if e.complexity.PiiMaskingAction.Disable == nil { + break + } + + return e.complexity.PiiMaskingAction.Disable(childComplexity), true + + case "PiiMaskingAction.id": + if e.complexity.PiiMaskingAction.ID == nil { + break + } + + return e.complexity.PiiMaskingAction.ID(childComplexity), true + + case "PiiMaskingAction.name": + if e.complexity.PiiMaskingAction.Name == nil { + break + } + + return e.complexity.PiiMaskingAction.Name(childComplexity), true + + case "PiiMaskingAction.notes": + if e.complexity.PiiMaskingAction.Notes == nil { + break + } + + return e.complexity.PiiMaskingAction.Notes(childComplexity), true + + case "PiiMaskingAction.signals": + if e.complexity.PiiMaskingAction.Signals == nil { + break + } + + return e.complexity.PiiMaskingAction.Signals(childComplexity), true + + case "PiiMaskingAction.type": + if e.complexity.PiiMaskingAction.Type == nil { + break + } + + return e.complexity.PiiMaskingAction.Type(childComplexity), true + + case "PodWorkload.kind": + if e.complexity.PodWorkload.Kind == nil { + break + } + + return e.complexity.PodWorkload.Kind(childComplexity), true + + case "PodWorkload.name": + if e.complexity.PodWorkload.Name == nil { + break + } + + return e.complexity.PodWorkload.Name(childComplexity), true + + case "PodWorkload.namespace": + if e.complexity.PodWorkload.Namespace == nil { + break + } + + return e.complexity.PodWorkload.Namespace(childComplexity), true + + case "ProbabilisticSamplerAction.details": + if e.complexity.ProbabilisticSamplerAction.Details == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Details(childComplexity), true + + case "ProbabilisticSamplerAction.disable": + if e.complexity.ProbabilisticSamplerAction.Disable == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Disable(childComplexity), true + + case "ProbabilisticSamplerAction.id": + if e.complexity.ProbabilisticSamplerAction.ID == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.ID(childComplexity), true + + case "ProbabilisticSamplerAction.name": + if e.complexity.ProbabilisticSamplerAction.Name == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Name(childComplexity), true + + case "ProbabilisticSamplerAction.notes": + if e.complexity.ProbabilisticSamplerAction.Notes == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Notes(childComplexity), true + + case "ProbabilisticSamplerAction.signals": + if e.complexity.ProbabilisticSamplerAction.Signals == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Signals(childComplexity), true + + case "ProbabilisticSamplerAction.type": + if e.complexity.ProbabilisticSamplerAction.Type == nil { + break + } + + return e.complexity.ProbabilisticSamplerAction.Type(childComplexity), true + + case "Query.computePlatform": + if e.complexity.Query.ComputePlatform == nil { + break + } + + return e.complexity.Query.ComputePlatform(childComplexity), true + + case "Query.config": + if e.complexity.Query.Config == nil { + break + } + + return e.complexity.Query.Config(childComplexity), true + + case "Query.destinationTypeDetails": + if e.complexity.Query.DestinationTypeDetails == nil { + break + } + + args, err := ec.field_Query_destinationTypeDetails_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DestinationTypeDetails(childComplexity, args["type"].(string)), true + + case "Query.destinationTypes": + if e.complexity.Query.DestinationTypes == nil { + break + } + + return e.complexity.Query.DestinationTypes(childComplexity), true + + case "Query.getOverviewMetrics": + if e.complexity.Query.GetOverviewMetrics == nil { + break + } + + return e.complexity.Query.GetOverviewMetrics(childComplexity), true + + case "Query.potentialDestinations": + if e.complexity.Query.PotentialDestinations == nil { + break + } + + return e.complexity.Query.PotentialDestinations(childComplexity), true + + case "RenameAttributeAction.details": + if e.complexity.RenameAttributeAction.Details == nil { + break + } + + return e.complexity.RenameAttributeAction.Details(childComplexity), true + + case "RenameAttributeAction.disable": + if e.complexity.RenameAttributeAction.Disable == nil { + break + } + + return e.complexity.RenameAttributeAction.Disable(childComplexity), true + + case "RenameAttributeAction.id": + if e.complexity.RenameAttributeAction.ID == nil { + break + } + + return e.complexity.RenameAttributeAction.ID(childComplexity), true + + case "RenameAttributeAction.name": + if e.complexity.RenameAttributeAction.Name == nil { + break + } + + return e.complexity.RenameAttributeAction.Name(childComplexity), true + + case "RenameAttributeAction.notes": + if e.complexity.RenameAttributeAction.Notes == nil { + break + } + + return e.complexity.RenameAttributeAction.Notes(childComplexity), true + + case "RenameAttributeAction.signals": + if e.complexity.RenameAttributeAction.Signals == nil { + break + } + + return e.complexity.RenameAttributeAction.Signals(childComplexity), true + + case "RenameAttributeAction.type": + if e.complexity.RenameAttributeAction.Type == nil { + break + } + + return e.complexity.RenameAttributeAction.Type(childComplexity), true + + case "SingleDestinationMetricsResponse.id": + if e.complexity.SingleDestinationMetricsResponse.ID == nil { + break + } + + return e.complexity.SingleDestinationMetricsResponse.ID(childComplexity), true + + case "SingleDestinationMetricsResponse.throughput": + if e.complexity.SingleDestinationMetricsResponse.Throughput == nil { + break + } + + return e.complexity.SingleDestinationMetricsResponse.Throughput(childComplexity), true + + case "SingleDestinationMetricsResponse.totalDataSent": + if e.complexity.SingleDestinationMetricsResponse.TotalDataSent == nil { + break + } + + return e.complexity.SingleDestinationMetricsResponse.TotalDataSent(childComplexity), true + + case "SingleSourceMetricsResponse.kind": + if e.complexity.SingleSourceMetricsResponse.Kind == nil { + break + } + + return e.complexity.SingleSourceMetricsResponse.Kind(childComplexity), true + + case "SingleSourceMetricsResponse.name": + if e.complexity.SingleSourceMetricsResponse.Name == nil { + break + } + + return e.complexity.SingleSourceMetricsResponse.Name(childComplexity), true + + case "SingleSourceMetricsResponse.namespace": + if e.complexity.SingleSourceMetricsResponse.Namespace == nil { + break + } + + return e.complexity.SingleSourceMetricsResponse.Namespace(childComplexity), true + + case "SingleSourceMetricsResponse.throughput": + if e.complexity.SingleSourceMetricsResponse.Throughput == nil { + break + } + + return e.complexity.SingleSourceMetricsResponse.Throughput(childComplexity), true + + case "SingleSourceMetricsResponse.totalDataSent": + if e.complexity.SingleSourceMetricsResponse.TotalDataSent == nil { + break + } + + return e.complexity.SingleSourceMetricsResponse.TotalDataSent(childComplexity), true + + case "SourceContainerRuntimeDetails.containerName": + if e.complexity.SourceContainerRuntimeDetails.ContainerName == nil { + break + } + + return e.complexity.SourceContainerRuntimeDetails.ContainerName(childComplexity), true + + case "SourceContainerRuntimeDetails.language": + if e.complexity.SourceContainerRuntimeDetails.Language == nil { + break + } + + return e.complexity.SourceContainerRuntimeDetails.Language(childComplexity), true + + case "SupportedSignals.logs": + if e.complexity.SupportedSignals.Logs == nil { + break + } + + return e.complexity.SupportedSignals.Logs(childComplexity), true + + case "SupportedSignals.metrics": + if e.complexity.SupportedSignals.Metrics == nil { + break + } + + return e.complexity.SupportedSignals.Metrics(childComplexity), true + + case "SupportedSignals.traces": + if e.complexity.SupportedSignals.Traces == nil { + break + } + + return e.complexity.SupportedSignals.Traces(childComplexity), true + + case "TestConnectionResponse.destinationType": + if e.complexity.TestConnectionResponse.DestinationType == nil { + break + } + + return e.complexity.TestConnectionResponse.DestinationType(childComplexity), true + + case "TestConnectionResponse.message": + if e.complexity.TestConnectionResponse.Message == nil { + break + } + + return e.complexity.TestConnectionResponse.Message(childComplexity), true + + case "TestConnectionResponse.reason": + if e.complexity.TestConnectionResponse.Reason == nil { + break + } + + return e.complexity.TestConnectionResponse.Reason(childComplexity), true + + case "TestConnectionResponse.statusCode": + if e.complexity.TestConnectionResponse.StatusCode == nil { + break + } + + return e.complexity.TestConnectionResponse.StatusCode(childComplexity), true + + case "TestConnectionResponse.succeeded": + if e.complexity.TestConnectionResponse.Succeeded == nil { + break + } + + return e.complexity.TestConnectionResponse.Succeeded(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.unmarshalInputActionInput, + ec.unmarshalInputDbQueryPayloadCollectionInput, + ec.unmarshalInputDestinationInput, + ec.unmarshalInputExportedSignalsInput, + ec.unmarshalInputFieldInput, + ec.unmarshalInputHttpPayloadCollectionInput, + ec.unmarshalInputInstrumentationLibraryGlobalIdInput, + ec.unmarshalInputInstrumentationRuleInput, + ec.unmarshalInputK8sDesiredNamespaceInput, + ec.unmarshalInputK8sDesiredSourceInput, + ec.unmarshalInputK8sNamespaceId, + ec.unmarshalInputK8sSourceId, + ec.unmarshalInputMessagingPayloadCollectionInput, + ec.unmarshalInputPatchSourceRequestInput, + ec.unmarshalInputPayloadCollectionInput, + ec.unmarshalInputPersistNamespaceItemInput, + ec.unmarshalInputPersistNamespaceSourceInput, + ec.unmarshalInputPodWorkloadInput, + ) + 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 +} + +//go:embed "schema.graphqls" +var sourcesFS embed.FS + +func sourceData(filename string) string { + data, err := sourcesFS.ReadFile(filename) + if err != nil { + panic(fmt.Sprintf("codegen problem: %s not available", filename)) + } + return string(data) +} + +var sources = []*ast.Source{ + {Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_ComputePlatform_k8sActualNamespace_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_ComputePlatform_k8sActualSource_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.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg1 + var arg2 *string + if tmp, ok := rawArgs["kind"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["kind"] = arg2 + return args, nil +} + +func (ec *executionContext) field_K8sActualNamespace_k8sActualSources_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["instrumentationLabeled"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instrumentationLabeled")) + arg0, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["instrumentationLabeled"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createAction_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.ActionInput + if tmp, ok := rawArgs["action"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("action")) + arg0, err = ec.unmarshalNActionInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐActionInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["action"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createInstrumentationRule_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.InstrumentationRuleInput + if tmp, ok := rawArgs["instrumentationRule"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instrumentationRule")) + arg0, err = ec.unmarshalNInstrumentationRuleInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRuleInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["instrumentationRule"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createNewDestination_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg0, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteAction_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 string + if tmp, ok := rawArgs["actionType"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("actionType")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["actionType"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteDestination_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_deleteInstrumentationRule_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["ruleId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ruleId")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ruleId"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_persistK8sNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.PersistNamespaceItemInput + if tmp, ok := rawArgs["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg0, err = ec.unmarshalNPersistNamespaceItemInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceItemInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_persistK8sSources_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["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg0 + var arg1 []*model.PersistNamespaceSourceInput + if tmp, ok := rawArgs["sources"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sources")) + arg1, err = ec.unmarshalNPersistNamespaceSourceInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["sources"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_testConnectionForDestination_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg0, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateAction_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 model.ActionInput + if tmp, ok := rawArgs["action"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("action")) + arg1, err = ec.unmarshalNActionInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐActionInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["action"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateDestination_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 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg1, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateInstrumentationRule_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["ruleId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ruleId")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ruleId"] = arg0 + var arg1 model.InstrumentationRuleInput + if tmp, ok := rawArgs["instrumentationRule"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instrumentationRule")) + arg1, err = ec.unmarshalNInstrumentationRuleInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRuleInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["instrumentationRule"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateK8sActualSource_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.K8sSourceID + if tmp, ok := rawArgs["sourceId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceId")) + arg0, err = ec.unmarshalNK8sSourceId2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sSourceID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["sourceId"] = arg0 + var arg1 model.PatchSourceRequestInput + if tmp, ok := rawArgs["patchSourceRequest"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patchSourceRequest")) + arg1, err = ec.unmarshalNPatchSourceRequestInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPatchSourceRequestInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["patchSourceRequest"] = arg1 + 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_destinationTypeDetails_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["type"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["type"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _AddClusterInfoAction_id(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_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_AddClusterInfoAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + 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) _AddClusterInfoAction_type(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AddClusterInfoAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AddClusterInfoAction_name(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_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_AddClusterInfoAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AddClusterInfoAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_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, nil + }) + 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_AddClusterInfoAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AddClusterInfoAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_AddClusterInfoAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + 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) _AddClusterInfoAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AddClusterInfoAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AddClusterInfoAction_details(ctx context.Context, field graphql.CollectedField, obj *model.AddClusterInfoAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AddClusterInfoAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ClusterInfo) + fc.Result = res + return ec.marshalNClusterInfo2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐClusterInfoᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AddClusterInfoAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AddClusterInfoAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "attributeName": + return ec.fieldContext_ClusterInfo_attributeName(ctx, field) + case "attributeStringValue": + return ec.fieldContext_ClusterInfo_attributeStringValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterInfo_attributeName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterInfo_attributeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AttributeName, nil + }) + if err != nil { + ec.Error(ctx, 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_ClusterInfo_attributeName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterInfo_attributeStringValue(ctx context.Context, field graphql.CollectedField, obj *model.ClusterInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterInfo_attributeStringValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AttributeStringValue, nil + }) + 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_ClusterInfo_attributeStringValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_computePlatformType(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_computePlatformType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComputePlatformType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ComputePlatformType) + fc.Result = res + return ec.marshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_computePlatformType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ComputePlatformType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualNamespace(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().K8sActualNamespace(rctx, obj, fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sActualNamespace) + fc.Result = res + return ec.marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_K8sActualNamespace_name(ctx, field) + case "instrumentationLabelEnabled": + return ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + case "k8sActualSources": + return ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualNamespace", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_ComputePlatform_k8sActualNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualNamespaces(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualNamespaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().K8sActualNamespaces(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualNamespace) + fc.Result = res + return ec.marshalNK8sActualNamespace2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualNamespaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_K8sActualNamespace_name(ctx, field) + case "instrumentationLabelEnabled": + return ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + case "k8sActualSources": + return ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualNamespace", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualSource(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualSource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().K8sActualSource(rctx, obj, fc.Args["name"].(*string), fc.Args["namespace"].(*string), fc.Args["kind"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sActualSource) + fc.Result = res + return ec.marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualSource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_ComputePlatform_k8sActualSource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualSources(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().K8sActualSources(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualSource) + fc.Result = res + return ec.marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualSources(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_destinations(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_destinations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().Destinations(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_destinations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + 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_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_actions(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_actions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().Actions(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.IcaInstanceResponse) + fc.Result = res + return ec.marshalNIcaInstanceResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponseᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_actions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + 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_IcaInstanceResponse_id(ctx, field) + case "type": + return ec.fieldContext_IcaInstanceResponse_type(ctx, field) + case "spec": + return ec.fieldContext_IcaInstanceResponse_spec(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IcaInstanceResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_instrumentationRules(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_instrumentationRules(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.ComputePlatform().InstrumentationRules(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.InstrumentationRule) + fc.Result = res + return ec.marshalNInstrumentationRule2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRuleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_instrumentationRules(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ruleId": + return ec.fieldContext_InstrumentationRule_ruleId(ctx, field) + case "ruleName": + return ec.fieldContext_InstrumentationRule_ruleName(ctx, field) + case "notes": + return ec.fieldContext_InstrumentationRule_notes(ctx, field) + case "disabled": + return ec.fieldContext_InstrumentationRule_disabled(ctx, field) + case "workloads": + return ec.fieldContext_InstrumentationRule_workloads(ctx, field) + case "instrumentationLibraries": + return ec.fieldContext_InstrumentationRule_instrumentationLibraries(ctx, field) + case "payloadCollection": + return ec.fieldContext_InstrumentationRule_payloadCollection(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationRule", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_type(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_status(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_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.(model.ConditionStatus) + fc.Result = res + return ec.marshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ConditionStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_lastTransitionTime(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_lastTransitionTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastTransitionTime, nil + }) + 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_Condition_lastTransitionTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_reason(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_reason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Reason, nil + }) + 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_Condition_reason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_message(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_message(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Message, nil + }) + 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_Condition_message(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DbQueryPayloadCollection_maxPayloadLength(ctx context.Context, field graphql.CollectedField, obj *model.DbQueryPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DbQueryPayloadCollection_maxPayloadLength(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxPayloadLength, 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.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DbQueryPayloadCollection_maxPayloadLength(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DbQueryPayloadCollection", + 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) _DbQueryPayloadCollection_dropPartialPayloads(ctx context.Context, field graphql.CollectedField, obj *model.DbQueryPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DbQueryPayloadCollection_dropPartialPayloads(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DropPartialPayloads, 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.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DbQueryPayloadCollection_dropPartialPayloads(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DbQueryPayloadCollection", + 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) _DeleteAttribute_attributeName(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttribute) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttribute_attributeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AttributeName, nil + }) + if err != nil { + ec.Error(ctx, 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_DeleteAttribute_attributeName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttribute", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DeleteAttributeAction_id(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_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_DeleteAttributeAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + 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) _DeleteAttributeAction_type(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DeleteAttributeAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DeleteAttributeAction_name(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_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_DeleteAttributeAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DeleteAttributeAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_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, nil + }) + 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_DeleteAttributeAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DeleteAttributeAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_DeleteAttributeAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + 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) _DeleteAttributeAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DeleteAttributeAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DeleteAttributeAction_details(ctx context.Context, field graphql.CollectedField, obj *model.DeleteAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DeleteAttributeAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, 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.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DeleteAttributeAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DeleteAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_id(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_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_Destination_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + 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) _Destination_name(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_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_Destination_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_type(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_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.resolvers.Destination().Type(rctx, obj) + }) + if err != nil { + ec.Error(ctx, 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_Destination_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_exportedSignals(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_exportedSignals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExportedSignals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ExportedSignals) + fc.Result = res + return ec.marshalNExportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignals(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_exportedSignals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "traces": + return ec.fieldContext_ExportedSignals_traces(ctx, field) + case "metrics": + return ec.fieldContext_ExportedSignals_metrics(ctx, field) + case "logs": + return ec.fieldContext_ExportedSignals_logs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExportedSignals", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_fields(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_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, nil + }) + if err != nil { + ec.Error(ctx, 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_Destination_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_destinationType(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_destinationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DestinationType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.DestinationTypesCategoryItem) + fc.Result = res + return ec.marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_destinationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_DestinationTypesCategoryItem_type(ctx, field) + case "displayName": + return ec.fieldContext_DestinationTypesCategoryItem_displayName(ctx, field) + case "imageUrl": + return ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + case "supportedSignals": + return ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + case "testConnectionSupported": + return ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationTypesCategoryItem", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_conditions(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_conditions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Destination().Conditions(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.Condition) + fc.Result = res + return ec.marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_conditions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Condition_type(ctx, field) + case "status": + return ec.fieldContext_Condition_status(ctx, field) + case "lastTransitionTime": + return ec.fieldContext_Condition_lastTransitionTime(ctx, field) + case "reason": + return ec.fieldContext_Condition_reason(ctx, field) + case "message": + return ec.fieldContext_Condition_message(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Condition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_type(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationDetails_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_urlString(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_urlString(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.URLString, nil + }) + if err != nil { + ec.Error(ctx, 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_DestinationDetails_urlString(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_fields(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_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, nil + }) + if err != nil { + ec.Error(ctx, 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_DestinationDetails_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_type(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_displayName(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_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_DestinationTypesCategoryItem_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_imageUrl(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageUrl, nil + }) + if err != nil { + ec.Error(ctx, 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_DestinationTypesCategoryItem_imageUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_supportedSignals(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SupportedSignals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.SupportedSignals) + fc.Result = res + return ec.marshalNSupportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSupportedSignals(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_supportedSignals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "traces": + return ec.fieldContext_SupportedSignals_traces(ctx, field) + case "metrics": + return ec.fieldContext_SupportedSignals_metrics(ctx, field) + case "logs": + return ec.fieldContext_SupportedSignals_logs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SupportedSignals", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_testConnectionSupported(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TestConnectionSupported, nil + }) + if err != nil { + ec.Error(ctx, 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_DestinationTypesCategoryItem_testConnectionSupported(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + 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) _DestinationsCategory_name(ctx context.Context, field graphql.CollectedField, obj *model.DestinationsCategory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationsCategory_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_DestinationsCategory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationsCategory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationsCategory_items(ctx context.Context, field graphql.CollectedField, obj *model.DestinationsCategory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationsCategory_items(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Items, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.DestinationTypesCategoryItem) + fc.Result = res + return ec.marshalNDestinationTypesCategoryItem2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationsCategory_items(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationsCategory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_DestinationTypesCategoryItem_type(ctx, field) + case "displayName": + return ec.fieldContext_DestinationTypesCategoryItem_displayName(ctx, field) + case "imageUrl": + return ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + case "supportedSignals": + return ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + case "testConnectionSupported": + return ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationTypesCategoryItem", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ErrorSamplerAction_id(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_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_ErrorSamplerAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + 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) _ErrorSamplerAction_type(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ErrorSamplerAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ErrorSamplerAction_name(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_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_ErrorSamplerAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ErrorSamplerAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_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, nil + }) + 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_ErrorSamplerAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ErrorSamplerAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_ErrorSamplerAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + 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) _ErrorSamplerAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ErrorSamplerAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ErrorSamplerAction_details(ctx context.Context, field graphql.CollectedField, obj *model.ErrorSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ErrorSamplerAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, 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_ErrorSamplerAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ErrorSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ExportedSignals_traces(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_traces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Traces, nil + }) + if err != nil { + ec.Error(ctx, 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_ExportedSignals_traces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + 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) _ExportedSignals_metrics(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_metrics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Metrics, nil + }) + if err != nil { + ec.Error(ctx, 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_ExportedSignals_metrics(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + 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) _ExportedSignals_logs(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_logs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Logs, nil + }) + if err != nil { + ec.Error(ctx, 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_ExportedSignals_logs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + 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) _Field_name(ctx context.Context, field graphql.CollectedField, obj *model.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_displayName(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_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_Field_displayName(_ 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_componentType(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_componentType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComponentType, nil + }) + if err != nil { + ec.Error(ctx, 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_componentType(_ 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_componentProperties(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_componentProperties(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComponentProperties, nil + }) + if err != nil { + ec.Error(ctx, 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_componentProperties(_ 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_videoUrl(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_videoUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VideoURL, nil + }) + 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_videoUrl(_ 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_thumbnailURL(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_thumbnailURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ThumbnailURL, nil + }) + 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_thumbnailURL(_ 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_initialValue(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_initialValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InitialValue, nil + }) + 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_initialValue(_ 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) _GetConfigResponse_installation(ctx context.Context, field graphql.CollectedField, obj *model.GetConfigResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetConfigResponse_installation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Installation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.InstallationStatus) + fc.Result = res + return ec.marshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetConfigResponse_installation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetConfigResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type InstallationStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GetDestinationDetailsResponse_fields(ctx context.Context, field graphql.CollectedField, obj *model.GetDestinationDetailsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetDestinationDetailsResponse_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, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Field) + fc.Result = res + return ec.marshalNField2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetDestinationDetailsResponse_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetDestinationDetailsResponse", + 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_Field_name(ctx, field) + case "displayName": + return ec.fieldContext_Field_displayName(ctx, field) + case "componentType": + return ec.fieldContext_Field_componentType(ctx, field) + case "componentProperties": + return ec.fieldContext_Field_componentProperties(ctx, field) + case "videoUrl": + return ec.fieldContext_Field_videoUrl(ctx, field) + case "thumbnailURL": + return ec.fieldContext_Field_thumbnailURL(ctx, field) + case "initialValue": + return ec.fieldContext_Field_initialValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Field", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GetDestinationTypesResponse_categories(ctx context.Context, field graphql.CollectedField, obj *model.GetDestinationTypesResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetDestinationTypesResponse_categories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Categories, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.DestinationsCategory) + fc.Result = res + return ec.marshalNDestinationsCategory2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategoryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetDestinationTypesResponse_categories(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetDestinationTypesResponse", + 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_DestinationsCategory_name(ctx, field) + case "items": + return ec.fieldContext_DestinationsCategory_items(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationsCategory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HttpPayloadCollection_mimeTypes(ctx context.Context, field graphql.CollectedField, obj *model.HTTPPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HttpPayloadCollection_mimeTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MimeTypes, nil + }) + 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_HttpPayloadCollection_mimeTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HttpPayloadCollection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HttpPayloadCollection_maxPayloadLength(ctx context.Context, field graphql.CollectedField, obj *model.HTTPPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HttpPayloadCollection_maxPayloadLength(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxPayloadLength, 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.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HttpPayloadCollection_maxPayloadLength(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HttpPayloadCollection", + 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) _HttpPayloadCollection_dropPartialPayloads(ctx context.Context, field graphql.CollectedField, obj *model.HTTPPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HttpPayloadCollection_dropPartialPayloads(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DropPartialPayloads, 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.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HttpPayloadCollection_dropPartialPayloads(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HttpPayloadCollection", + 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) _IcaInstanceResponse_id(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_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.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IcaInstanceResponse_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IcaInstanceResponse_type(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IcaInstanceResponse_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IcaInstanceResponse_spec(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_spec(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Spec, nil + }) + if err != nil { + ec.Error(ctx, 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_IcaInstanceResponse_spec(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibrary_libraryName(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibrary) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibrary_libraryName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LibraryName, nil + }) + if err != nil { + ec.Error(ctx, 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_InstrumentationLibrary_libraryName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibrary", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibrary_options(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibrary) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibrary_options(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Options, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.InstrumentationOption) + fc.Result = res + return ec.marshalNInstrumentationOption2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOptionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationLibrary_options(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibrary", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "optionKey": + return ec.fieldContext_InstrumentationOption_optionKey(ctx, field) + case "spanKind": + return ec.fieldContext_InstrumentationOption_spanKind(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationOption", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibraryGlobalId_name(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibraryGlobalID) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibraryGlobalId_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_InstrumentationLibraryGlobalId_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibraryGlobalId", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibraryGlobalId_spanKind(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibraryGlobalID) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibraryGlobalId_spanKind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpanKind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.SpanKind) + fc.Result = res + return ec.marshalOSpanKind2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationLibraryGlobalId_spanKind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibraryGlobalId", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SpanKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibraryGlobalId_language(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibraryGlobalID) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibraryGlobalId_language(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Language, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ProgrammingLanguage) + fc.Result = res + return ec.marshalOProgrammingLanguage2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐProgrammingLanguage(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationLibraryGlobalId_language(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibraryGlobalId", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ProgrammingLanguage does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationOption_optionKey(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationOption) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationOption_optionKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OptionKey, nil + }) + if err != nil { + ec.Error(ctx, 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_InstrumentationOption_optionKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationOption", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationOption_spanKind(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationOption) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationOption_spanKind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpanKind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.SpanKind) + fc.Result = res + return ec.marshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationOption_spanKind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationOption", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SpanKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationRule_ruleId(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_ruleId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RuleID, nil + }) + if err != nil { + ec.Error(ctx, 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_InstrumentationRule_ruleId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + 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) _InstrumentationRule_ruleName(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_ruleName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RuleName, nil + }) + 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_InstrumentationRule_ruleName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationRule_notes(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_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, nil + }) + 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_InstrumentationRule_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationRule_disabled(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_disabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disabled, 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.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationRule_disabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + 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) _InstrumentationRule_workloads(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_workloads(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Workloads, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.PodWorkload) + fc.Result = res + return ec.marshalOPodWorkload2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationRule_workloads(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_PodWorkload_namespace(ctx, field) + case "kind": + return ec.fieldContext_PodWorkload_kind(ctx, field) + case "name": + return ec.fieldContext_PodWorkload_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PodWorkload", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationRule_instrumentationLibraries(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_instrumentationLibraries(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentationLibraries, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.InstrumentationLibraryGlobalID) + fc.Result = res + return ec.marshalOInstrumentationLibraryGlobalId2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationRule_instrumentationLibraries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + 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_InstrumentationLibraryGlobalId_name(ctx, field) + case "spanKind": + return ec.fieldContext_InstrumentationLibraryGlobalId_spanKind(ctx, field) + case "language": + return ec.fieldContext_InstrumentationLibraryGlobalId_language(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationLibraryGlobalId", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationRule_payloadCollection(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationRule) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationRule_payloadCollection(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PayloadCollection, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.PayloadCollection) + fc.Result = res + return ec.marshalOPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPayloadCollection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationRule_payloadCollection(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationRule", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "httpRequest": + return ec.fieldContext_PayloadCollection_httpRequest(ctx, field) + case "httpResponse": + return ec.fieldContext_PayloadCollection_httpResponse(ctx, field) + case "dbQuery": + return ec.fieldContext_PayloadCollection_dbQuery(ctx, field) + case "messaging": + return ec.fieldContext_PayloadCollection_messaging(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PayloadCollection", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_containers(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_containers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Containers, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.SourceContainerRuntimeDetails) + fc.Result = res + return ec.marshalOSourceContainerRuntimeDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetailsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_containers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "containerName": + return ec.fieldContext_SourceContainerRuntimeDetails_containerName(ctx, field) + case "language": + return ec.fieldContext_SourceContainerRuntimeDetails_language(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SourceContainerRuntimeDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_conditions(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_conditions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Conditions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.Condition) + fc.Result = res + return ec.marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_conditions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Condition_type(ctx, field) + case "status": + return ec.fieldContext_Condition_status(ctx, field) + case "lastTransitionTime": + return ec.fieldContext_Condition_lastTransitionTime(ctx, field) + case "reason": + return ec.fieldContext_Condition_reason(ctx, field) + case "message": + return ec.fieldContext_Condition_message(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Condition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_instrumentationOptions(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_instrumentationOptions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentationOptions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.InstrumentationLibrary) + fc.Result = res + return ec.marshalNInstrumentationLibrary2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_instrumentationOptions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "libraryName": + return ec.fieldContext_InstrumentationLibrary_libraryName(ctx, field) + case "options": + return ec.fieldContext_InstrumentationLibrary_options(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationLibrary", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualNamespace_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_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_K8sActualNamespace_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualNamespace_instrumentationLabelEnabled(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentationLabelEnabled, 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.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualNamespace_instrumentationLabelEnabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + 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) _K8sActualNamespace_k8sActualSources(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.K8sActualNamespace().K8sActualSources(rctx, obj, fc.Args["instrumentationLabeled"].(*bool)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualSource) + fc.Result = res + return ec.marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualNamespace_k8sActualSources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_K8sActualNamespace_k8sActualSources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_namespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_namespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Namespace, nil + }) + if err != nil { + ec.Error(ctx, 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_K8sActualSource_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_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.(model.K8sResourceKind) + fc.Result = res + return ec.marshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8sResourceKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_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_K8sActualSource_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_serviceName(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_serviceName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ServiceName, nil + }) + 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_K8sActualSource_serviceName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_numberOfInstances(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NumberOfInstances, 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.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_numberOfInstances(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + 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) _K8sActualSource_reportedName(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_reportedName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReportedName, nil + }) + 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_K8sActualSource_reportedName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_autoInstrumented(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AutoInstrumented, nil + }) + if err != nil { + ec.Error(ctx, 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_K8sActualSource_autoInstrumented(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + 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) _K8sActualSource_autoInstrumentedDecision(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AutoInstrumentedDecision, nil + }) + if err != nil { + ec.Error(ctx, 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_K8sActualSource_autoInstrumentedDecision(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_instrumentedApplicationDetails(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentedApplicationDetails, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.InstrumentedApplicationDetails) + fc.Result = res + return ec.marshalOInstrumentedApplicationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentedApplicationDetails(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_instrumentedApplicationDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "containers": + return ec.fieldContext_InstrumentedApplicationDetails_containers(ctx, field) + case "conditions": + return ec.fieldContext_InstrumentedApplicationDetails_conditions(ctx, field) + case "instrumentationOptions": + return ec.fieldContext_InstrumentedApplicationDetails_instrumentationOptions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentedApplicationDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _LatencySamplerAction_id(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_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_LatencySamplerAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + 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) _LatencySamplerAction_type(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LatencySamplerAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LatencySamplerAction_name(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_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_LatencySamplerAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LatencySamplerAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_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, nil + }) + 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_LatencySamplerAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LatencySamplerAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_LatencySamplerAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + 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) _LatencySamplerAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LatencySamplerAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LatencySamplerAction_details(ctx context.Context, field graphql.CollectedField, obj *model.LatencySamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LatencySamplerAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, 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.marshalNString2ᚕᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LatencySamplerAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LatencySamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MessagingPayloadCollection_maxPayloadLength(ctx context.Context, field graphql.CollectedField, obj *model.MessagingPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MessagingPayloadCollection_maxPayloadLength(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxPayloadLength, 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.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MessagingPayloadCollection_maxPayloadLength(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MessagingPayloadCollection", + 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) _MessagingPayloadCollection_dropPartialPayloads(ctx context.Context, field graphql.CollectedField, obj *model.MessagingPayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MessagingPayloadCollection_dropPartialPayloads(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DropPartialPayloads, 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.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MessagingPayloadCollection_dropPartialPayloads(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MessagingPayloadCollection", + 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) _Mutation_createNewDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createNewDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().CreateNewDestination(rctx, fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createNewDestination(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 "id": + return ec.fieldContext_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + defer func() { + if 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_createNewDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_persistK8sNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_persistK8sNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().PersistK8sNamespace(rctx, fc.Args["namespace"].(model.PersistNamespaceItemInput)) + }) + if err != nil { + ec.Error(ctx, 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_Mutation_persistK8sNamespace(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_persistK8sNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_persistK8sSources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_persistK8sSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().PersistK8sSources(rctx, fc.Args["namespace"].(string), fc.Args["sources"].([]*model.PersistNamespaceSourceInput)) + }) + if err != nil { + ec.Error(ctx, 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_Mutation_persistK8sSources(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_persistK8sSources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_testConnectionForDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_testConnectionForDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().TestConnectionForDestination(rctx, fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.TestConnectionResponse) + fc.Result = res + return ec.marshalNTestConnectionResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_testConnectionForDestination(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 "succeeded": + return ec.fieldContext_TestConnectionResponse_succeeded(ctx, field) + case "statusCode": + return ec.fieldContext_TestConnectionResponse_statusCode(ctx, field) + case "destinationType": + return ec.fieldContext_TestConnectionResponse_destinationType(ctx, field) + case "message": + return ec.fieldContext_TestConnectionResponse_message(ctx, field) + case "reason": + return ec.fieldContext_TestConnectionResponse_reason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TestConnectionResponse", field.Name) + }, + } + defer func() { + if 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_testConnectionForDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateK8sActualSource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateK8sActualSource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().UpdateK8sActualSource(rctx, fc.Args["sourceId"].(model.K8sSourceID), fc.Args["patchSourceRequest"].(model.PatchSourceRequestInput)) + }) + if err != nil { + ec.Error(ctx, 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_Mutation_updateK8sActualSource(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateK8sActualSource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().UpdateDestination(rctx, fc.Args["id"].(string), fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateDestination(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 "id": + return ec.fieldContext_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + defer func() { + if 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_updateDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DeleteDestination(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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteDestination(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createAction(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createAction(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().CreateAction(rctx, fc.Args["action"].(model.ActionInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.Action) + fc.Result = res + return ec.marshalNAction2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐAction(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createAction(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) { + 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_Mutation_createAction_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateAction(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateAction(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().UpdateAction(rctx, fc.Args["id"].(string), fc.Args["action"].(model.ActionInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.Action) + fc.Result = res + return ec.marshalNAction2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐAction(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateAction(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) { + 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_Mutation_updateAction_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteAction(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteAction(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DeleteAction(rctx, fc.Args["id"].(string), fc.Args["actionType"].(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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteAction(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteAction_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createInstrumentationRule(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createInstrumentationRule(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().CreateInstrumentationRule(rctx, fc.Args["instrumentationRule"].(model.InstrumentationRuleInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.InstrumentationRule) + fc.Result = res + return ec.marshalNInstrumentationRule2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRule(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createInstrumentationRule(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 "ruleId": + return ec.fieldContext_InstrumentationRule_ruleId(ctx, field) + case "ruleName": + return ec.fieldContext_InstrumentationRule_ruleName(ctx, field) + case "notes": + return ec.fieldContext_InstrumentationRule_notes(ctx, field) + case "disabled": + return ec.fieldContext_InstrumentationRule_disabled(ctx, field) + case "workloads": + return ec.fieldContext_InstrumentationRule_workloads(ctx, field) + case "instrumentationLibraries": + return ec.fieldContext_InstrumentationRule_instrumentationLibraries(ctx, field) + case "payloadCollection": + return ec.fieldContext_InstrumentationRule_payloadCollection(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationRule", field.Name) + }, + } + defer func() { + if 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_createInstrumentationRule_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateInstrumentationRule(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateInstrumentationRule(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().UpdateInstrumentationRule(rctx, fc.Args["ruleId"].(string), fc.Args["instrumentationRule"].(model.InstrumentationRuleInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.InstrumentationRule) + fc.Result = res + return ec.marshalNInstrumentationRule2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRule(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateInstrumentationRule(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 "ruleId": + return ec.fieldContext_InstrumentationRule_ruleId(ctx, field) + case "ruleName": + return ec.fieldContext_InstrumentationRule_ruleName(ctx, field) + case "notes": + return ec.fieldContext_InstrumentationRule_notes(ctx, field) + case "disabled": + return ec.fieldContext_InstrumentationRule_disabled(ctx, field) + case "workloads": + return ec.fieldContext_InstrumentationRule_workloads(ctx, field) + case "instrumentationLibraries": + return ec.fieldContext_InstrumentationRule_instrumentationLibraries(ctx, field) + case "payloadCollection": + return ec.fieldContext_InstrumentationRule_payloadCollection(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationRule", field.Name) + }, + } + defer func() { + if 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_updateInstrumentationRule_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteInstrumentationRule(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteInstrumentationRule(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DeleteInstrumentationRule(rctx, fc.Args["ruleId"].(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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteInstrumentationRule(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) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteInstrumentationRule_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ObservabilitySignalSupport_supported(ctx context.Context, field graphql.CollectedField, obj *model.ObservabilitySignalSupport) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Supported, nil + }) + if err != nil { + ec.Error(ctx, 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_ObservabilitySignalSupport_supported(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ObservabilitySignalSupport", + 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) _OverviewMetricsResponse_sources(ctx context.Context, field graphql.CollectedField, obj *model.OverviewMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OverviewMetricsResponse_sources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.SingleSourceMetricsResponse) + fc.Result = res + return ec.marshalNSingleSourceMetricsResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleSourceMetricsResponseᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OverviewMetricsResponse_sources(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OverviewMetricsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_SingleSourceMetricsResponse_namespace(ctx, field) + case "kind": + return ec.fieldContext_SingleSourceMetricsResponse_kind(ctx, field) + case "name": + return ec.fieldContext_SingleSourceMetricsResponse_name(ctx, field) + case "totalDataSent": + return ec.fieldContext_SingleSourceMetricsResponse_totalDataSent(ctx, field) + case "throughput": + return ec.fieldContext_SingleSourceMetricsResponse_throughput(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SingleSourceMetricsResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OverviewMetricsResponse_destinations(ctx context.Context, field graphql.CollectedField, obj *model.OverviewMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OverviewMetricsResponse_destinations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Destinations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.SingleDestinationMetricsResponse) + fc.Result = res + return ec.marshalNSingleDestinationMetricsResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleDestinationMetricsResponseᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OverviewMetricsResponse_destinations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OverviewMetricsResponse", + 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_SingleDestinationMetricsResponse_id(ctx, field) + case "totalDataSent": + return ec.fieldContext_SingleDestinationMetricsResponse_totalDataSent(ctx, field) + case "throughput": + return ec.fieldContext_SingleDestinationMetricsResponse_throughput(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SingleDestinationMetricsResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PayloadCollection_httpRequest(ctx context.Context, field graphql.CollectedField, obj *model.PayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadCollection_httpRequest(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPRequest, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.HTTPPayloadCollection) + fc.Result = res + return ec.marshalOHttpPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PayloadCollection_httpRequest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PayloadCollection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "mimeTypes": + return ec.fieldContext_HttpPayloadCollection_mimeTypes(ctx, field) + case "maxPayloadLength": + return ec.fieldContext_HttpPayloadCollection_maxPayloadLength(ctx, field) + case "dropPartialPayloads": + return ec.fieldContext_HttpPayloadCollection_dropPartialPayloads(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HttpPayloadCollection", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PayloadCollection_httpResponse(ctx context.Context, field graphql.CollectedField, obj *model.PayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadCollection_httpResponse(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPResponse, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.HTTPPayloadCollection) + fc.Result = res + return ec.marshalOHttpPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PayloadCollection_httpResponse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PayloadCollection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "mimeTypes": + return ec.fieldContext_HttpPayloadCollection_mimeTypes(ctx, field) + case "maxPayloadLength": + return ec.fieldContext_HttpPayloadCollection_maxPayloadLength(ctx, field) + case "dropPartialPayloads": + return ec.fieldContext_HttpPayloadCollection_dropPartialPayloads(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HttpPayloadCollection", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PayloadCollection_dbQuery(ctx context.Context, field graphql.CollectedField, obj *model.PayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadCollection_dbQuery(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DbQuery, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.DbQueryPayloadCollection) + fc.Result = res + return ec.marshalODbQueryPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDbQueryPayloadCollection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PayloadCollection_dbQuery(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PayloadCollection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "maxPayloadLength": + return ec.fieldContext_DbQueryPayloadCollection_maxPayloadLength(ctx, field) + case "dropPartialPayloads": + return ec.fieldContext_DbQueryPayloadCollection_dropPartialPayloads(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DbQueryPayloadCollection", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PayloadCollection_messaging(ctx context.Context, field graphql.CollectedField, obj *model.PayloadCollection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PayloadCollection_messaging(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Messaging, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.MessagingPayloadCollection) + fc.Result = res + return ec.marshalOMessagingPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐMessagingPayloadCollection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PayloadCollection_messaging(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PayloadCollection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "maxPayloadLength": + return ec.fieldContext_MessagingPayloadCollection_maxPayloadLength(ctx, field) + case "dropPartialPayloads": + return ec.fieldContext_MessagingPayloadCollection_dropPartialPayloads(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type MessagingPayloadCollection", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PiiMaskingAction_id(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_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_PiiMaskingAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + 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) _PiiMaskingAction_type(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PiiMaskingAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PiiMaskingAction_name(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_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_PiiMaskingAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PiiMaskingAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_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, nil + }) + 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_PiiMaskingAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PiiMaskingAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_PiiMaskingAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + 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) _PiiMaskingAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PiiMaskingAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PiiMaskingAction_details(ctx context.Context, field graphql.CollectedField, obj *model.PiiMaskingAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PiiMaskingAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + 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_PiiMaskingAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PiiMaskingAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PodWorkload_namespace(ctx context.Context, field graphql.CollectedField, obj *model.PodWorkload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PodWorkload_namespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Namespace, nil + }) + if err != nil { + ec.Error(ctx, 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_PodWorkload_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PodWorkload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PodWorkload_kind(ctx context.Context, field graphql.CollectedField, obj *model.PodWorkload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PodWorkload_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.(model.K8sResourceKind) + fc.Result = res + return ec.marshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PodWorkload_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PodWorkload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8sResourceKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PodWorkload_name(ctx context.Context, field graphql.CollectedField, obj *model.PodWorkload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PodWorkload_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_PodWorkload_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PodWorkload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProbabilisticSamplerAction_id(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_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_ProbabilisticSamplerAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + 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) _ProbabilisticSamplerAction_type(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProbabilisticSamplerAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProbabilisticSamplerAction_name(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_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_ProbabilisticSamplerAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProbabilisticSamplerAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_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, nil + }) + 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_ProbabilisticSamplerAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProbabilisticSamplerAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_ProbabilisticSamplerAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + 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) _ProbabilisticSamplerAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProbabilisticSamplerAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProbabilisticSamplerAction_details(ctx context.Context, field graphql.CollectedField, obj *model.ProbabilisticSamplerAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProbabilisticSamplerAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, 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_ProbabilisticSamplerAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProbabilisticSamplerAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_computePlatform(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_computePlatform(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().ComputePlatform(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ComputePlatform) + fc.Result = res + return ec.marshalOComputePlatform2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatform(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_computePlatform(_ 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 "computePlatformType": + return ec.fieldContext_ComputePlatform_computePlatformType(ctx, field) + case "k8sActualNamespace": + return ec.fieldContext_ComputePlatform_k8sActualNamespace(ctx, field) + case "k8sActualNamespaces": + return ec.fieldContext_ComputePlatform_k8sActualNamespaces(ctx, field) + case "k8sActualSource": + return ec.fieldContext_ComputePlatform_k8sActualSource(ctx, field) + case "k8sActualSources": + return ec.fieldContext_ComputePlatform_k8sActualSources(ctx, field) + case "destinations": + return ec.fieldContext_ComputePlatform_destinations(ctx, field) + case "actions": + return ec.fieldContext_ComputePlatform_actions(ctx, field) + case "instrumentationRules": + return ec.fieldContext_ComputePlatform_instrumentationRules(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ComputePlatform", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_config(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_config(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().Config(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetConfigResponse) + fc.Result = res + return ec.marshalOGetConfigResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetConfigResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_config(_ 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 "installation": + return ec.fieldContext_GetConfigResponse_installation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetConfigResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_destinationTypes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_destinationTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DestinationTypes(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetDestinationTypesResponse) + fc.Result = res + return ec.marshalOGetDestinationTypesResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationTypesResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_destinationTypes(_ 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 "categories": + return ec.fieldContext_GetDestinationTypesResponse_categories(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetDestinationTypesResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_destinationTypeDetails(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_destinationTypeDetails(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DestinationTypeDetails(rctx, fc.Args["type"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetDestinationDetailsResponse) + fc.Result = res + return ec.marshalOGetDestinationDetailsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationDetailsResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_destinationTypeDetails(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 "fields": + return ec.fieldContext_GetDestinationDetailsResponse_fields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetDestinationDetailsResponse", field.Name) + }, + } + defer func() { + if 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_destinationTypeDetails_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_potentialDestinations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_potentialDestinations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().PotentialDestinations(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.DestinationDetails) + fc.Result = res + return ec.marshalNDestinationDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetailsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_potentialDestinations(_ 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 "type": + return ec.fieldContext_DestinationDetails_type(ctx, field) + case "urlString": + return ec.fieldContext_DestinationDetails_urlString(ctx, field) + case "fields": + return ec.fieldContext_DestinationDetails_fields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_getOverviewMetrics(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getOverviewMetrics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().GetOverviewMetrics(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.OverviewMetricsResponse) + fc.Result = res + return ec.marshalNOverviewMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐOverviewMetricsResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getOverviewMetrics(_ 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 "sources": + return ec.fieldContext_OverviewMetricsResponse_sources(ctx, field) + case "destinations": + return ec.fieldContext_OverviewMetricsResponse_destinations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OverviewMetricsResponse", field.Name) + }, + } + 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) _RenameAttributeAction_id(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_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_RenameAttributeAction_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + 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) _RenameAttributeAction_type(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RenameAttributeAction_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RenameAttributeAction_name(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_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_RenameAttributeAction_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RenameAttributeAction_notes(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_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, nil + }) + 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_RenameAttributeAction_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RenameAttributeAction_disable(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_disable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disable, nil + }) + if err != nil { + ec.Error(ctx, 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_RenameAttributeAction_disable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + 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) _RenameAttributeAction_signals(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_signals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Signals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.SignalType) + fc.Result = res + return ec.marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RenameAttributeAction_signals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SignalType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RenameAttributeAction_details(ctx context.Context, field graphql.CollectedField, obj *model.RenameAttributeAction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RenameAttributeAction_details(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Details, nil + }) + if err != nil { + ec.Error(ctx, 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_RenameAttributeAction_details(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RenameAttributeAction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SingleDestinationMetricsResponse_id(ctx context.Context, field graphql.CollectedField, obj *model.SingleDestinationMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleDestinationMetricsResponse_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.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SingleDestinationMetricsResponse_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleDestinationMetricsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SingleDestinationMetricsResponse_totalDataSent(ctx context.Context, field graphql.CollectedField, obj *model.SingleDestinationMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleDestinationMetricsResponse_totalDataSent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalDataSent, nil + }) + if err != nil { + ec.Error(ctx, 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_SingleDestinationMetricsResponse_totalDataSent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleDestinationMetricsResponse", + 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) _SingleDestinationMetricsResponse_throughput(ctx context.Context, field graphql.CollectedField, obj *model.SingleDestinationMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleDestinationMetricsResponse_throughput(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Throughput, nil + }) + if err != nil { + ec.Error(ctx, 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_SingleDestinationMetricsResponse_throughput(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleDestinationMetricsResponse", + 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) _SingleSourceMetricsResponse_namespace(ctx context.Context, field graphql.CollectedField, obj *model.SingleSourceMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleSourceMetricsResponse_namespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Namespace, nil + }) + if err != nil { + ec.Error(ctx, 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_SingleSourceMetricsResponse_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleSourceMetricsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SingleSourceMetricsResponse_kind(ctx context.Context, field graphql.CollectedField, obj *model.SingleSourceMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleSourceMetricsResponse_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.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SingleSourceMetricsResponse_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleSourceMetricsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SingleSourceMetricsResponse_name(ctx context.Context, field graphql.CollectedField, obj *model.SingleSourceMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleSourceMetricsResponse_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_SingleSourceMetricsResponse_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleSourceMetricsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SingleSourceMetricsResponse_totalDataSent(ctx context.Context, field graphql.CollectedField, obj *model.SingleSourceMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleSourceMetricsResponse_totalDataSent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalDataSent, nil + }) + if err != nil { + ec.Error(ctx, 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_SingleSourceMetricsResponse_totalDataSent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleSourceMetricsResponse", + 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) _SingleSourceMetricsResponse_throughput(ctx context.Context, field graphql.CollectedField, obj *model.SingleSourceMetricsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SingleSourceMetricsResponse_throughput(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Throughput, nil + }) + if err != nil { + ec.Error(ctx, 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_SingleSourceMetricsResponse_throughput(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SingleSourceMetricsResponse", + 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) _SourceContainerRuntimeDetails_containerName(ctx context.Context, field graphql.CollectedField, obj *model.SourceContainerRuntimeDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SourceContainerRuntimeDetails_containerName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ContainerName, nil + }) + if err != nil { + ec.Error(ctx, 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_SourceContainerRuntimeDetails_containerName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SourceContainerRuntimeDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SourceContainerRuntimeDetails_language(ctx context.Context, field graphql.CollectedField, obj *model.SourceContainerRuntimeDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SourceContainerRuntimeDetails_language(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Language, nil + }) + if err != nil { + ec.Error(ctx, 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_SourceContainerRuntimeDetails_language(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SourceContainerRuntimeDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_traces(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_traces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Traces, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_traces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_metrics(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_metrics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Metrics, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_metrics(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_logs(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_logs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Logs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_logs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_succeeded(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_succeeded(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Succeeded, nil + }) + if err != nil { + ec.Error(ctx, 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_TestConnectionResponse_succeeded(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + 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) _TestConnectionResponse_statusCode(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_statusCode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StatusCode, nil + }) + if err != nil { + ec.Error(ctx, 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_TestConnectionResponse_statusCode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + 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) _TestConnectionResponse_destinationType(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_destinationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DestinationType, nil + }) + 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_TestConnectionResponse_destinationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_message(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_message(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Message, nil + }) + 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_TestConnectionResponse_message(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_reason(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_reason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Reason, nil + }) + 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_TestConnectionResponse_reason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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_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) unmarshalInputActionInput(ctx context.Context, obj interface{}) (model.ActionInput, error) { + var it model.ActionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"type", "name", "notes", "disable", "signals", "details"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Type = 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 "notes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("notes")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Notes = data + case "disable": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("disable")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Disable = data + case "signals": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("signals")) + data, err := ec.unmarshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.Signals = data + case "details": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("details")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Details = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDbQueryPayloadCollectionInput(ctx context.Context, obj interface{}) (model.DbQueryPayloadCollectionInput, error) { + var it model.DbQueryPayloadCollectionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"maxPayloadLength", "dropPartialPayloads"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "maxPayloadLength": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxPayloadLength")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.MaxPayloadLength = data + case "dropPartialPayloads": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dropPartialPayloads")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.DropPartialPayloads = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDestinationInput(ctx context.Context, obj interface{}) (model.DestinationInput, error) { + var it model.DestinationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "type", "exportedSignals", "fields"} + 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 "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Type = data + case "exportedSignals": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exportedSignals")) + data, err := ec.unmarshalNExportedSignalsInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignalsInput(ctx, v) + if err != nil { + return it, err + } + it.ExportedSignals = data + case "fields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fields")) + data, err := ec.unmarshalNFieldInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Fields = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputExportedSignalsInput(ctx context.Context, obj interface{}) (model.ExportedSignalsInput, error) { + var it model.ExportedSignalsInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"traces", "metrics", "logs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "traces": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("traces")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Traces = data + case "metrics": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metrics")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Metrics = data + case "logs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logs")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Logs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFieldInput(ctx context.Context, obj interface{}) (model.FieldInput, error) { + var it model.FieldInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "key": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Key = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHttpPayloadCollectionInput(ctx context.Context, obj interface{}) (model.HTTPPayloadCollectionInput, error) { + var it model.HTTPPayloadCollectionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"mimeTypes", "maxPayloadLength", "dropPartialPayloads"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "mimeTypes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mimeTypes")) + data, err := ec.unmarshalOString2ᚕᚖstring(ctx, v) + if err != nil { + return it, err + } + it.MimeTypes = data + case "maxPayloadLength": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxPayloadLength")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.MaxPayloadLength = data + case "dropPartialPayloads": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dropPartialPayloads")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.DropPartialPayloads = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputInstrumentationLibraryGlobalIdInput(ctx context.Context, obj interface{}) (model.InstrumentationLibraryGlobalIDInput, error) { + var it model.InstrumentationLibraryGlobalIDInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "spanKind", "language"} + 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 "spanKind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spanKind")) + data, err := ec.unmarshalOSpanKind2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx, v) + if err != nil { + return it, err + } + it.SpanKind = data + case "language": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("language")) + data, err := ec.unmarshalOProgrammingLanguage2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐProgrammingLanguage(ctx, v) + if err != nil { + return it, err + } + it.Language = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputInstrumentationRuleInput(ctx context.Context, obj interface{}) (model.InstrumentationRuleInput, error) { + var it model.InstrumentationRuleInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"ruleName", "notes", "disabled", "workloads", "instrumentationLibraries", "payloadCollection"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "ruleName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ruleName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RuleName = data + case "notes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("notes")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Notes = data + case "disabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("disabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Disabled = data + case "workloads": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("workloads")) + data, err := ec.unmarshalOPodWorkloadInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Workloads = data + case "instrumentationLibraries": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instrumentationLibraries")) + data, err := ec.unmarshalOInstrumentationLibraryGlobalIdInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.InstrumentationLibraries = data + case "payloadCollection": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("payloadCollection")) + data, err := ec.unmarshalOPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPayloadCollectionInput(ctx, v) + if err != nil { + return it, err + } + it.PayloadCollection = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sDesiredNamespaceInput(ctx context.Context, obj interface{}) (model.K8sDesiredNamespaceInput, error) { + var it model.K8sDesiredNamespaceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"autoInstrument"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "autoInstrument": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("autoInstrument")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.AutoInstrument = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sDesiredSourceInput(ctx context.Context, obj interface{}) (model.K8sDesiredSourceInput, error) { + var it model.K8sDesiredSourceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"serviceName", "autoInstrument"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "serviceName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ServiceName = data + case "autoInstrument": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("autoInstrument")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.AutoInstrument = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sNamespaceId(ctx context.Context, obj interface{}) (model.K8sNamespaceID, error) { + var it model.K8sNamespaceID + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name"} + 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 + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sSourceId(ctx context.Context, obj interface{}) (model.K8sSourceID, error) { + var it model.K8sSourceID + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"namespace", "kind", "name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "namespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Namespace = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, v) + if err != nil { + return it, err + } + it.Kind = 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 + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMessagingPayloadCollectionInput(ctx context.Context, obj interface{}) (model.MessagingPayloadCollectionInput, error) { + var it model.MessagingPayloadCollectionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"maxPayloadLength", "dropPartialPayloads"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "maxPayloadLength": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxPayloadLength")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.MaxPayloadLength = data + case "dropPartialPayloads": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dropPartialPayloads")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.DropPartialPayloads = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPatchSourceRequestInput(ctx context.Context, obj interface{}) (model.PatchSourceRequestInput, error) { + var it model.PatchSourceRequestInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"reportedName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "reportedName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reportedName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ReportedName = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPayloadCollectionInput(ctx context.Context, obj interface{}) (model.PayloadCollectionInput, error) { + var it model.PayloadCollectionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"httpRequest", "httpResponse", "dbQuery", "messaging"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "httpRequest": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpRequest")) + data, err := ec.unmarshalOHttpPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollectionInput(ctx, v) + if err != nil { + return it, err + } + it.HTTPRequest = data + case "httpResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpResponse")) + data, err := ec.unmarshalOHttpPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollectionInput(ctx, v) + if err != nil { + return it, err + } + it.HTTPResponse = data + case "dbQuery": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dbQuery")) + data, err := ec.unmarshalODbQueryPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDbQueryPayloadCollectionInput(ctx, v) + if err != nil { + return it, err + } + it.DbQuery = data + case "messaging": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("messaging")) + data, err := ec.unmarshalOMessagingPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐMessagingPayloadCollectionInput(ctx, v) + if err != nil { + return it, err + } + it.Messaging = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersistNamespaceItemInput(ctx context.Context, obj interface{}) (model.PersistNamespaceItemInput, error) { + var it model.PersistNamespaceItemInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "futureSelected"} + 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 "futureSelected": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("futureSelected")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.FutureSelected = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersistNamespaceSourceInput(ctx context.Context, obj interface{}) (model.PersistNamespaceSourceInput, error) { + var it model.PersistNamespaceSourceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "kind", "selected"} + 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 "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "selected": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("selected")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Selected = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPodWorkloadInput(ctx context.Context, obj interface{}) (model.PodWorkloadInput, error) { + var it model.PodWorkloadInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"namespace", "kind", "name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "namespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Namespace = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, v) + if err != nil { + return it, err + } + it.Kind = 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 + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _Action(ctx context.Context, sel ast.SelectionSet, obj model.Action) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.AddClusterInfoAction: + return ec._AddClusterInfoAction(ctx, sel, &obj) + case *model.AddClusterInfoAction: + if obj == nil { + return graphql.Null + } + return ec._AddClusterInfoAction(ctx, sel, obj) + case model.DeleteAttributeAction: + return ec._DeleteAttributeAction(ctx, sel, &obj) + case *model.DeleteAttributeAction: + if obj == nil { + return graphql.Null + } + return ec._DeleteAttributeAction(ctx, sel, obj) + case model.PiiMaskingAction: + return ec._PiiMaskingAction(ctx, sel, &obj) + case *model.PiiMaskingAction: + if obj == nil { + return graphql.Null + } + return ec._PiiMaskingAction(ctx, sel, obj) + case model.ErrorSamplerAction: + return ec._ErrorSamplerAction(ctx, sel, &obj) + case *model.ErrorSamplerAction: + if obj == nil { + return graphql.Null + } + return ec._ErrorSamplerAction(ctx, sel, obj) + case model.LatencySamplerAction: + return ec._LatencySamplerAction(ctx, sel, &obj) + case *model.LatencySamplerAction: + if obj == nil { + return graphql.Null + } + return ec._LatencySamplerAction(ctx, sel, obj) + case model.ProbabilisticSamplerAction: + return ec._ProbabilisticSamplerAction(ctx, sel, &obj) + case *model.ProbabilisticSamplerAction: + if obj == nil { + return graphql.Null + } + return ec._ProbabilisticSamplerAction(ctx, sel, obj) + case model.RenameAttributeAction: + return ec._RenameAttributeAction(ctx, sel, &obj) + case *model.RenameAttributeAction: + if obj == nil { + return graphql.Null + } + return ec._RenameAttributeAction(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var addClusterInfoActionImplementors = []string{"AddClusterInfoAction", "Action"} + +func (ec *executionContext) _AddClusterInfoAction(ctx context.Context, sel ast.SelectionSet, obj *model.AddClusterInfoAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, addClusterInfoActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AddClusterInfoAction") + case "id": + out.Values[i] = ec._AddClusterInfoAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._AddClusterInfoAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._AddClusterInfoAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._AddClusterInfoAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._AddClusterInfoAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._AddClusterInfoAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._AddClusterInfoAction_details(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 clusterInfoImplementors = []string{"ClusterInfo"} + +func (ec *executionContext) _ClusterInfo(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterInfoImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterInfo") + case "attributeName": + out.Values[i] = ec._ClusterInfo_attributeName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "attributeStringValue": + out.Values[i] = ec._ClusterInfo_attributeStringValue(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 computePlatformImplementors = []string{"ComputePlatform"} + +func (ec *executionContext) _ComputePlatform(ctx context.Context, sel ast.SelectionSet, obj *model.ComputePlatform) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, computePlatformImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ComputePlatform") + case "computePlatformType": + out.Values[i] = ec._ComputePlatform_computePlatformType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "k8sActualNamespace": + 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._ComputePlatform_k8sActualNamespace(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 "k8sActualNamespaces": + 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._ComputePlatform_k8sActualNamespaces(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 "k8sActualSource": + 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._ComputePlatform_k8sActualSource(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 "k8sActualSources": + 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._ComputePlatform_k8sActualSources(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 "destinations": + 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._ComputePlatform_destinations(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 "actions": + 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._ComputePlatform_actions(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 "instrumentationRules": + 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._ComputePlatform_instrumentationRules(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var conditionImplementors = []string{"Condition"} + +func (ec *executionContext) _Condition(ctx context.Context, sel ast.SelectionSet, obj *model.Condition) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, conditionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Condition") + case "type": + out.Values[i] = ec._Condition_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "status": + out.Values[i] = ec._Condition_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "lastTransitionTime": + out.Values[i] = ec._Condition_lastTransitionTime(ctx, field, obj) + case "reason": + out.Values[i] = ec._Condition_reason(ctx, field, obj) + case "message": + out.Values[i] = ec._Condition_message(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 dbQueryPayloadCollectionImplementors = []string{"DbQueryPayloadCollection"} + +func (ec *executionContext) _DbQueryPayloadCollection(ctx context.Context, sel ast.SelectionSet, obj *model.DbQueryPayloadCollection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dbQueryPayloadCollectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DbQueryPayloadCollection") + case "maxPayloadLength": + out.Values[i] = ec._DbQueryPayloadCollection_maxPayloadLength(ctx, field, obj) + case "dropPartialPayloads": + out.Values[i] = ec._DbQueryPayloadCollection_dropPartialPayloads(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 deleteAttributeImplementors = []string{"DeleteAttribute"} + +func (ec *executionContext) _DeleteAttribute(ctx context.Context, sel ast.SelectionSet, obj *model.DeleteAttribute) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, deleteAttributeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DeleteAttribute") + case "attributeName": + out.Values[i] = ec._DeleteAttribute_attributeName(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 deleteAttributeActionImplementors = []string{"DeleteAttributeAction", "Action"} + +func (ec *executionContext) _DeleteAttributeAction(ctx context.Context, sel ast.SelectionSet, obj *model.DeleteAttributeAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, deleteAttributeActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DeleteAttributeAction") + case "id": + out.Values[i] = ec._DeleteAttributeAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._DeleteAttributeAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._DeleteAttributeAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._DeleteAttributeAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._DeleteAttributeAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._DeleteAttributeAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._DeleteAttributeAction_details(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 destinationImplementors = []string{"Destination"} + +func (ec *executionContext) _Destination(ctx context.Context, sel ast.SelectionSet, obj *model.Destination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Destination") + case "id": + out.Values[i] = ec._Destination_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._Destination_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "type": + 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._Destination_type(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 "exportedSignals": + out.Values[i] = ec._Destination_exportedSignals(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fields": + out.Values[i] = ec._Destination_fields(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "destinationType": + out.Values[i] = ec._Destination_destinationType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "conditions": + 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._Destination_conditions(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 destinationDetailsImplementors = []string{"DestinationDetails"} + +func (ec *executionContext) _DestinationDetails(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationDetails") + case "type": + out.Values[i] = ec._DestinationDetails_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "urlString": + out.Values[i] = ec._DestinationDetails_urlString(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fields": + out.Values[i] = ec._DestinationDetails_fields(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 destinationTypesCategoryItemImplementors = []string{"DestinationTypesCategoryItem"} + +func (ec *executionContext) _DestinationTypesCategoryItem(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationTypesCategoryItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationTypesCategoryItemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationTypesCategoryItem") + case "type": + out.Values[i] = ec._DestinationTypesCategoryItem_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "displayName": + out.Values[i] = ec._DestinationTypesCategoryItem_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "imageUrl": + out.Values[i] = ec._DestinationTypesCategoryItem_imageUrl(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "supportedSignals": + out.Values[i] = ec._DestinationTypesCategoryItem_supportedSignals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "testConnectionSupported": + out.Values[i] = ec._DestinationTypesCategoryItem_testConnectionSupported(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 destinationsCategoryImplementors = []string{"DestinationsCategory"} + +func (ec *executionContext) _DestinationsCategory(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationsCategory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationsCategoryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationsCategory") + case "name": + out.Values[i] = ec._DestinationsCategory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "items": + out.Values[i] = ec._DestinationsCategory_items(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 errorSamplerActionImplementors = []string{"ErrorSamplerAction", "Action"} + +func (ec *executionContext) _ErrorSamplerAction(ctx context.Context, sel ast.SelectionSet, obj *model.ErrorSamplerAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, errorSamplerActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ErrorSamplerAction") + case "id": + out.Values[i] = ec._ErrorSamplerAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._ErrorSamplerAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._ErrorSamplerAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._ErrorSamplerAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._ErrorSamplerAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._ErrorSamplerAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._ErrorSamplerAction_details(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 exportedSignalsImplementors = []string{"ExportedSignals"} + +func (ec *executionContext) _ExportedSignals(ctx context.Context, sel ast.SelectionSet, obj *model.ExportedSignals) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, exportedSignalsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ExportedSignals") + case "traces": + out.Values[i] = ec._ExportedSignals_traces(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metrics": + out.Values[i] = ec._ExportedSignals_metrics(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "logs": + out.Values[i] = ec._ExportedSignals_logs(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 fieldImplementors = []string{"Field"} + +func (ec *executionContext) _Field(ctx context.Context, sel ast.SelectionSet, obj *model.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 "displayName": + out.Values[i] = ec._Field_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "componentType": + out.Values[i] = ec._Field_componentType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "componentProperties": + out.Values[i] = ec._Field_componentProperties(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "videoUrl": + out.Values[i] = ec._Field_videoUrl(ctx, field, obj) + case "thumbnailURL": + out.Values[i] = ec._Field_thumbnailURL(ctx, field, obj) + case "initialValue": + out.Values[i] = ec._Field_initialValue(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 getConfigResponseImplementors = []string{"GetConfigResponse"} + +func (ec *executionContext) _GetConfigResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetConfigResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getConfigResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetConfigResponse") + case "installation": + out.Values[i] = ec._GetConfigResponse_installation(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 getDestinationDetailsResponseImplementors = []string{"GetDestinationDetailsResponse"} + +func (ec *executionContext) _GetDestinationDetailsResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetDestinationDetailsResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getDestinationDetailsResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetDestinationDetailsResponse") + case "fields": + out.Values[i] = ec._GetDestinationDetailsResponse_fields(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 getDestinationTypesResponseImplementors = []string{"GetDestinationTypesResponse"} + +func (ec *executionContext) _GetDestinationTypesResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetDestinationTypesResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getDestinationTypesResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetDestinationTypesResponse") + case "categories": + out.Values[i] = ec._GetDestinationTypesResponse_categories(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 httpPayloadCollectionImplementors = []string{"HttpPayloadCollection"} + +func (ec *executionContext) _HttpPayloadCollection(ctx context.Context, sel ast.SelectionSet, obj *model.HTTPPayloadCollection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, httpPayloadCollectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("HttpPayloadCollection") + case "mimeTypes": + out.Values[i] = ec._HttpPayloadCollection_mimeTypes(ctx, field, obj) + case "maxPayloadLength": + out.Values[i] = ec._HttpPayloadCollection_maxPayloadLength(ctx, field, obj) + case "dropPartialPayloads": + out.Values[i] = ec._HttpPayloadCollection_dropPartialPayloads(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 icaInstanceResponseImplementors = []string{"IcaInstanceResponse"} + +func (ec *executionContext) _IcaInstanceResponse(ctx context.Context, sel ast.SelectionSet, obj *model.IcaInstanceResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, icaInstanceResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("IcaInstanceResponse") + case "id": + out.Values[i] = ec._IcaInstanceResponse_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._IcaInstanceResponse_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "spec": + out.Values[i] = ec._IcaInstanceResponse_spec(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 instrumentationLibraryImplementors = []string{"InstrumentationLibrary"} + +func (ec *executionContext) _InstrumentationLibrary(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationLibrary) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationLibraryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationLibrary") + case "libraryName": + out.Values[i] = ec._InstrumentationLibrary_libraryName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "options": + out.Values[i] = ec._InstrumentationLibrary_options(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 instrumentationLibraryGlobalIdImplementors = []string{"InstrumentationLibraryGlobalId"} + +func (ec *executionContext) _InstrumentationLibraryGlobalId(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationLibraryGlobalID) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationLibraryGlobalIdImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationLibraryGlobalId") + case "name": + out.Values[i] = ec._InstrumentationLibraryGlobalId_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "spanKind": + out.Values[i] = ec._InstrumentationLibraryGlobalId_spanKind(ctx, field, obj) + case "language": + out.Values[i] = ec._InstrumentationLibraryGlobalId_language(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 instrumentationOptionImplementors = []string{"InstrumentationOption"} + +func (ec *executionContext) _InstrumentationOption(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationOption) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationOptionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationOption") + case "optionKey": + out.Values[i] = ec._InstrumentationOption_optionKey(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "spanKind": + out.Values[i] = ec._InstrumentationOption_spanKind(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 instrumentationRuleImplementors = []string{"InstrumentationRule"} + +func (ec *executionContext) _InstrumentationRule(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationRule) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationRuleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationRule") + case "ruleId": + out.Values[i] = ec._InstrumentationRule_ruleId(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ruleName": + out.Values[i] = ec._InstrumentationRule_ruleName(ctx, field, obj) + case "notes": + out.Values[i] = ec._InstrumentationRule_notes(ctx, field, obj) + case "disabled": + out.Values[i] = ec._InstrumentationRule_disabled(ctx, field, obj) + case "workloads": + out.Values[i] = ec._InstrumentationRule_workloads(ctx, field, obj) + case "instrumentationLibraries": + out.Values[i] = ec._InstrumentationRule_instrumentationLibraries(ctx, field, obj) + case "payloadCollection": + out.Values[i] = ec._InstrumentationRule_payloadCollection(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 instrumentedApplicationDetailsImplementors = []string{"InstrumentedApplicationDetails"} + +func (ec *executionContext) _InstrumentedApplicationDetails(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentedApplicationDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentedApplicationDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentedApplicationDetails") + case "containers": + out.Values[i] = ec._InstrumentedApplicationDetails_containers(ctx, field, obj) + case "conditions": + out.Values[i] = ec._InstrumentedApplicationDetails_conditions(ctx, field, obj) + case "instrumentationOptions": + out.Values[i] = ec._InstrumentedApplicationDetails_instrumentationOptions(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 k8sActualNamespaceImplementors = []string{"K8sActualNamespace"} + +func (ec *executionContext) _K8sActualNamespace(ctx context.Context, sel ast.SelectionSet, obj *model.K8sActualNamespace) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8sActualNamespaceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8sActualNamespace") + case "name": + out.Values[i] = ec._K8sActualNamespace_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "instrumentationLabelEnabled": + out.Values[i] = ec._K8sActualNamespace_instrumentationLabelEnabled(ctx, field, obj) + case "k8sActualSources": + 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._K8sActualNamespace_k8sActualSources(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var k8sActualSourceImplementors = []string{"K8sActualSource"} + +func (ec *executionContext) _K8sActualSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sActualSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8sActualSourceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8sActualSource") + case "namespace": + out.Values[i] = ec._K8sActualSource_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kind": + out.Values[i] = ec._K8sActualSource_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._K8sActualSource_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "serviceName": + out.Values[i] = ec._K8sActualSource_serviceName(ctx, field, obj) + case "numberOfInstances": + out.Values[i] = ec._K8sActualSource_numberOfInstances(ctx, field, obj) + case "reportedName": + out.Values[i] = ec._K8sActualSource_reportedName(ctx, field, obj) + case "autoInstrumented": + out.Values[i] = ec._K8sActualSource_autoInstrumented(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "autoInstrumentedDecision": + out.Values[i] = ec._K8sActualSource_autoInstrumentedDecision(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "instrumentedApplicationDetails": + out.Values[i] = ec._K8sActualSource_instrumentedApplicationDetails(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 latencySamplerActionImplementors = []string{"LatencySamplerAction", "Action"} + +func (ec *executionContext) _LatencySamplerAction(ctx context.Context, sel ast.SelectionSet, obj *model.LatencySamplerAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, latencySamplerActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("LatencySamplerAction") + case "id": + out.Values[i] = ec._LatencySamplerAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._LatencySamplerAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._LatencySamplerAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._LatencySamplerAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._LatencySamplerAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._LatencySamplerAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._LatencySamplerAction_details(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 messagingPayloadCollectionImplementors = []string{"MessagingPayloadCollection"} + +func (ec *executionContext) _MessagingPayloadCollection(ctx context.Context, sel ast.SelectionSet, obj *model.MessagingPayloadCollection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, messagingPayloadCollectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MessagingPayloadCollection") + case "maxPayloadLength": + out.Values[i] = ec._MessagingPayloadCollection_maxPayloadLength(ctx, field, obj) + case "dropPartialPayloads": + out.Values[i] = ec._MessagingPayloadCollection_dropPartialPayloads(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 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 "createNewDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createNewDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "persistK8sNamespace": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_persistK8sNamespace(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "persistK8sSources": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_persistK8sSources(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "testConnectionForDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_testConnectionForDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateK8sActualSource": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateK8sActualSource(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createAction": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createAction(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateAction": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateAction(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteAction": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteAction(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createInstrumentationRule": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createInstrumentationRule(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateInstrumentationRule": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateInstrumentationRule(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteInstrumentationRule": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteInstrumentationRule(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 observabilitySignalSupportImplementors = []string{"ObservabilitySignalSupport"} + +func (ec *executionContext) _ObservabilitySignalSupport(ctx context.Context, sel ast.SelectionSet, obj *model.ObservabilitySignalSupport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, observabilitySignalSupportImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ObservabilitySignalSupport") + case "supported": + out.Values[i] = ec._ObservabilitySignalSupport_supported(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 overviewMetricsResponseImplementors = []string{"OverviewMetricsResponse"} + +func (ec *executionContext) _OverviewMetricsResponse(ctx context.Context, sel ast.SelectionSet, obj *model.OverviewMetricsResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, overviewMetricsResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("OverviewMetricsResponse") + case "sources": + out.Values[i] = ec._OverviewMetricsResponse_sources(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "destinations": + out.Values[i] = ec._OverviewMetricsResponse_destinations(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 payloadCollectionImplementors = []string{"PayloadCollection"} + +func (ec *executionContext) _PayloadCollection(ctx context.Context, sel ast.SelectionSet, obj *model.PayloadCollection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, payloadCollectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PayloadCollection") + case "httpRequest": + out.Values[i] = ec._PayloadCollection_httpRequest(ctx, field, obj) + case "httpResponse": + out.Values[i] = ec._PayloadCollection_httpResponse(ctx, field, obj) + case "dbQuery": + out.Values[i] = ec._PayloadCollection_dbQuery(ctx, field, obj) + case "messaging": + out.Values[i] = ec._PayloadCollection_messaging(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 piiMaskingActionImplementors = []string{"PiiMaskingAction", "Action"} + +func (ec *executionContext) _PiiMaskingAction(ctx context.Context, sel ast.SelectionSet, obj *model.PiiMaskingAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, piiMaskingActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PiiMaskingAction") + case "id": + out.Values[i] = ec._PiiMaskingAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._PiiMaskingAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._PiiMaskingAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._PiiMaskingAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._PiiMaskingAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._PiiMaskingAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._PiiMaskingAction_details(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 podWorkloadImplementors = []string{"PodWorkload"} + +func (ec *executionContext) _PodWorkload(ctx context.Context, sel ast.SelectionSet, obj *model.PodWorkload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, podWorkloadImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PodWorkload") + case "namespace": + out.Values[i] = ec._PodWorkload_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kind": + out.Values[i] = ec._PodWorkload_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._PodWorkload_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 probabilisticSamplerActionImplementors = []string{"ProbabilisticSamplerAction", "Action"} + +func (ec *executionContext) _ProbabilisticSamplerAction(ctx context.Context, sel ast.SelectionSet, obj *model.ProbabilisticSamplerAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, probabilisticSamplerActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProbabilisticSamplerAction") + case "id": + out.Values[i] = ec._ProbabilisticSamplerAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._ProbabilisticSamplerAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._ProbabilisticSamplerAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._ProbabilisticSamplerAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._ProbabilisticSamplerAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._ProbabilisticSamplerAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._ProbabilisticSamplerAction_details(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 "computePlatform": + 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_computePlatform(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 "config": + 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_config(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 "destinationTypes": + 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_destinationTypes(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 "destinationTypeDetails": + 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_destinationTypeDetails(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 "potentialDestinations": + 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_potentialDestinations(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 "getOverviewMetrics": + 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_getOverviewMetrics(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 renameAttributeActionImplementors = []string{"RenameAttributeAction", "Action"} + +func (ec *executionContext) _RenameAttributeAction(ctx context.Context, sel ast.SelectionSet, obj *model.RenameAttributeAction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, renameAttributeActionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("RenameAttributeAction") + case "id": + out.Values[i] = ec._RenameAttributeAction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._RenameAttributeAction_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._RenameAttributeAction_name(ctx, field, obj) + case "notes": + out.Values[i] = ec._RenameAttributeAction_notes(ctx, field, obj) + case "disable": + out.Values[i] = ec._RenameAttributeAction_disable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "signals": + out.Values[i] = ec._RenameAttributeAction_signals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "details": + out.Values[i] = ec._RenameAttributeAction_details(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 singleDestinationMetricsResponseImplementors = []string{"SingleDestinationMetricsResponse"} + +func (ec *executionContext) _SingleDestinationMetricsResponse(ctx context.Context, sel ast.SelectionSet, obj *model.SingleDestinationMetricsResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, singleDestinationMetricsResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SingleDestinationMetricsResponse") + case "id": + out.Values[i] = ec._SingleDestinationMetricsResponse_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalDataSent": + out.Values[i] = ec._SingleDestinationMetricsResponse_totalDataSent(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "throughput": + out.Values[i] = ec._SingleDestinationMetricsResponse_throughput(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 singleSourceMetricsResponseImplementors = []string{"SingleSourceMetricsResponse"} + +func (ec *executionContext) _SingleSourceMetricsResponse(ctx context.Context, sel ast.SelectionSet, obj *model.SingleSourceMetricsResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, singleSourceMetricsResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SingleSourceMetricsResponse") + case "namespace": + out.Values[i] = ec._SingleSourceMetricsResponse_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kind": + out.Values[i] = ec._SingleSourceMetricsResponse_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._SingleSourceMetricsResponse_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalDataSent": + out.Values[i] = ec._SingleSourceMetricsResponse_totalDataSent(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "throughput": + out.Values[i] = ec._SingleSourceMetricsResponse_throughput(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 sourceContainerRuntimeDetailsImplementors = []string{"SourceContainerRuntimeDetails"} + +func (ec *executionContext) _SourceContainerRuntimeDetails(ctx context.Context, sel ast.SelectionSet, obj *model.SourceContainerRuntimeDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, sourceContainerRuntimeDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SourceContainerRuntimeDetails") + case "containerName": + out.Values[i] = ec._SourceContainerRuntimeDetails_containerName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "language": + out.Values[i] = ec._SourceContainerRuntimeDetails_language(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 supportedSignalsImplementors = []string{"SupportedSignals"} + +func (ec *executionContext) _SupportedSignals(ctx context.Context, sel ast.SelectionSet, obj *model.SupportedSignals) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, supportedSignalsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SupportedSignals") + case "traces": + out.Values[i] = ec._SupportedSignals_traces(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metrics": + out.Values[i] = ec._SupportedSignals_metrics(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "logs": + out.Values[i] = ec._SupportedSignals_logs(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 testConnectionResponseImplementors = []string{"TestConnectionResponse"} + +func (ec *executionContext) _TestConnectionResponse(ctx context.Context, sel ast.SelectionSet, obj *model.TestConnectionResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, testConnectionResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("TestConnectionResponse") + case "succeeded": + out.Values[i] = ec._TestConnectionResponse_succeeded(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "statusCode": + out.Values[i] = ec._TestConnectionResponse_statusCode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "destinationType": + out.Values[i] = ec._TestConnectionResponse_destinationType(ctx, field, obj) + case "message": + out.Values[i] = ec._TestConnectionResponse_message(ctx, field, obj) + case "reason": + out.Values[i] = ec._TestConnectionResponse_reason(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 __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) marshalNAction2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐAction(ctx context.Context, sel ast.SelectionSet, v model.Action) 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._Action(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNActionInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐActionInput(ctx context.Context, v interface{}) (model.ActionInput, error) { + res, err := ec.unmarshalInputActionInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +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) marshalNClusterInfo2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐClusterInfoᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterInfo) 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.marshalNClusterInfo2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐClusterInfo(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) marshalNClusterInfo2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐClusterInfo(ctx context.Context, sel ast.SelectionSet, v *model.ClusterInfo) 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._ClusterInfo(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx context.Context, v interface{}) (model.ComputePlatformType, error) { + var res model.ComputePlatformType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx context.Context, sel ast.SelectionSet, v model.ComputePlatformType) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNCondition2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐCondition(ctx context.Context, sel ast.SelectionSet, v *model.Condition) 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._Condition(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx context.Context, v interface{}) (model.ConditionStatus, error) { + var res model.ConditionStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx context.Context, sel ast.SelectionSet, v model.ConditionStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNDestination2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx context.Context, sel ast.SelectionSet, v model.Destination) graphql.Marshaler { + return ec._Destination(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestination2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Destination) 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.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(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) marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx context.Context, sel ast.SelectionSet, v *model.Destination) 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._Destination(ctx, sel, v) +} + +func (ec *executionContext) marshalNDestinationDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetailsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DestinationDetails) 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.marshalNDestinationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetails(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) marshalNDestinationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetails(ctx context.Context, sel ast.SelectionSet, v *model.DestinationDetails) 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._DestinationDetails(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx context.Context, v interface{}) (model.DestinationInput, error) { + res, err := ec.unmarshalInputDestinationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(ctx context.Context, sel ast.SelectionSet, v model.DestinationTypesCategoryItem) graphql.Marshaler { + return ec._DestinationTypesCategoryItem(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestinationTypesCategoryItem2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItemᚄ(ctx context.Context, sel ast.SelectionSet, v []model.DestinationTypesCategoryItem) 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.marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(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) marshalNDestinationsCategory2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategory(ctx context.Context, sel ast.SelectionSet, v model.DestinationsCategory) graphql.Marshaler { + return ec._DestinationsCategory(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestinationsCategory2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategoryᚄ(ctx context.Context, sel ast.SelectionSet, v []model.DestinationsCategory) 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.marshalNDestinationsCategory2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategory(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) marshalNExportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignals(ctx context.Context, sel ast.SelectionSet, v model.ExportedSignals) graphql.Marshaler { + return ec._ExportedSignals(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalNExportedSignalsInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignalsInput(ctx context.Context, v interface{}) (*model.ExportedSignalsInput, error) { + res, err := ec.unmarshalInputExportedSignalsInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNField2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Field) 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.marshalNField2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐ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) marshalNField2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐField(ctx context.Context, sel ast.SelectionSet, v *model.Field) 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._Field(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFieldInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInputᚄ(ctx context.Context, v interface{}) ([]*model.FieldInput, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FieldInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFieldInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNFieldInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInput(ctx context.Context, v interface{}) (*model.FieldInput, error) { + res, err := ec.unmarshalInputFieldInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalID(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) marshalNIcaInstanceResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponseᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.IcaInstanceResponse) 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.marshalNIcaInstanceResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponse(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) marshalNIcaInstanceResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponse(ctx context.Context, sel ast.SelectionSet, v *model.IcaInstanceResponse) 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._IcaInstanceResponse(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx context.Context, v interface{}) (model.InstallationStatus, error) { + var res model.InstallationStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx context.Context, sel ast.SelectionSet, v model.InstallationStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNInstrumentationLibrary2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationLibrary) 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.marshalNInstrumentationLibrary2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibrary(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) marshalNInstrumentationLibrary2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibrary(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationLibrary) 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._InstrumentationLibrary(ctx, sel, v) +} + +func (ec *executionContext) marshalNInstrumentationLibraryGlobalId2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalID(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationLibraryGlobalID) 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._InstrumentationLibraryGlobalId(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInstrumentationLibraryGlobalIdInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDInput(ctx context.Context, v interface{}) (*model.InstrumentationLibraryGlobalIDInput, error) { + res, err := ec.unmarshalInputInstrumentationLibraryGlobalIdInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInstrumentationOption2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOptionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationOption) 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.marshalNInstrumentationOption2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOption(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) marshalNInstrumentationOption2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOption(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationOption) 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._InstrumentationOption(ctx, sel, v) +} + +func (ec *executionContext) marshalNInstrumentationRule2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRule(ctx context.Context, sel ast.SelectionSet, v model.InstrumentationRule) graphql.Marshaler { + return ec._InstrumentationRule(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInstrumentationRule2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRuleᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationRule) 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.marshalNInstrumentationRule2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRule(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) marshalNInstrumentationRule2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRule(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationRule) 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._InstrumentationRule(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInstrumentationRuleInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationRuleInput(ctx context.Context, v interface{}) (model.InstrumentationRuleInput, error) { + res, err := ec.unmarshalInputInstrumentationRuleInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +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) marshalNK8sActualNamespace2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx context.Context, sel ast.SelectionSet, v []*model.K8sActualNamespace) 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.marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx context.Context, sel ast.SelectionSet, v []*model.K8sActualSource) 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.marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx context.Context, v interface{}) (model.K8sResourceKind, error) { + var res model.K8sResourceKind + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx context.Context, sel ast.SelectionSet, v model.K8sResourceKind) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNK8sSourceId2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sSourceID(ctx context.Context, v interface{}) (model.K8sSourceID, error) { + res, err := ec.unmarshalInputK8sSourceId(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx context.Context, sel ast.SelectionSet, v model.ObservabilitySignalSupport) graphql.Marshaler { + return ec._ObservabilitySignalSupport(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOverviewMetricsResponse2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐOverviewMetricsResponse(ctx context.Context, sel ast.SelectionSet, v model.OverviewMetricsResponse) graphql.Marshaler { + return ec._OverviewMetricsResponse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOverviewMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐOverviewMetricsResponse(ctx context.Context, sel ast.SelectionSet, v *model.OverviewMetricsResponse) 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._OverviewMetricsResponse(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNPatchSourceRequestInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPatchSourceRequestInput(ctx context.Context, v interface{}) (model.PatchSourceRequestInput, error) { + res, err := ec.unmarshalInputPatchSourceRequestInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNPersistNamespaceItemInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceItemInput(ctx context.Context, v interface{}) (model.PersistNamespaceItemInput, error) { + res, err := ec.unmarshalInputPersistNamespaceItemInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNPersistNamespaceSourceInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInputᚄ(ctx context.Context, v interface{}) ([]*model.PersistNamespaceSourceInput, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.PersistNamespaceSourceInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNPersistNamespaceSourceInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNPersistNamespaceSourceInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInput(ctx context.Context, v interface{}) (*model.PersistNamespaceSourceInput, error) { + res, err := ec.unmarshalInputPersistNamespaceSourceInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNPodWorkload2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkload(ctx context.Context, sel ast.SelectionSet, v *model.PodWorkload) 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._PodWorkload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNPodWorkloadInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadInput(ctx context.Context, v interface{}) (*model.PodWorkloadInput, error) { + res, err := ec.unmarshalInputPodWorkloadInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNSignalType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalType(ctx context.Context, v interface{}) (model.SignalType, error) { + var res model.SignalType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNSignalType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalType(ctx context.Context, sel ast.SelectionSet, v model.SignalType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx context.Context, v interface{}) ([]model.SignalType, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]model.SignalType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNSignalType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNSignalType2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []model.SignalType) 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.marshalNSignalType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSignalType(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) marshalNSingleDestinationMetricsResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleDestinationMetricsResponseᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SingleDestinationMetricsResponse) 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.marshalNSingleDestinationMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleDestinationMetricsResponse(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) marshalNSingleDestinationMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleDestinationMetricsResponse(ctx context.Context, sel ast.SelectionSet, v *model.SingleDestinationMetricsResponse) 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._SingleDestinationMetricsResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalNSingleSourceMetricsResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleSourceMetricsResponseᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SingleSourceMetricsResponse) 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.marshalNSingleSourceMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleSourceMetricsResponse(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) marshalNSingleSourceMetricsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSingleSourceMetricsResponse(ctx context.Context, sel ast.SelectionSet, v *model.SingleSourceMetricsResponse) 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._SingleSourceMetricsResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalNSourceContainerRuntimeDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetails(ctx context.Context, sel ast.SelectionSet, v *model.SourceContainerRuntimeDetails) 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._SourceContainerRuntimeDetails(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, v interface{}) (model.SpanKind, error) { + var res model.SpanKind + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, sel ast.SelectionSet, v model.SpanKind) graphql.Marshaler { + return v +} + +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) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel ast.SelectionSet, v []*string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalOString2ᚖstring(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) marshalNSupportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSupportedSignals(ctx context.Context, sel ast.SelectionSet, v model.SupportedSignals) graphql.Marshaler { + return ec._SupportedSignals(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTestConnectionResponse2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx context.Context, sel ast.SelectionSet, v model.TestConnectionResponse) graphql.Marshaler { + return ec._TestConnectionResponse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTestConnectionResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx context.Context, sel ast.SelectionSet, v *model.TestConnectionResponse) 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._TestConnectionResponse(ctx, sel, v) +} + +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) 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) marshalOComputePlatform2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatform(ctx context.Context, sel ast.SelectionSet, v *model.ComputePlatform) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ComputePlatform(ctx, sel, v) +} + +func (ec *executionContext) marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Condition) 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.marshalNCondition2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐCondition(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) marshalODbQueryPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDbQueryPayloadCollection(ctx context.Context, sel ast.SelectionSet, v *model.DbQueryPayloadCollection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DbQueryPayloadCollection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalODbQueryPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDbQueryPayloadCollectionInput(ctx context.Context, v interface{}) (*model.DbQueryPayloadCollectionInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDbQueryPayloadCollectionInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGetConfigResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetConfigResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetConfigResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetConfigResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOGetDestinationDetailsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationDetailsResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetDestinationDetailsResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetDestinationDetailsResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOGetDestinationTypesResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationTypesResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetDestinationTypesResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetDestinationTypesResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOHttpPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollection(ctx context.Context, sel ast.SelectionSet, v *model.HTTPPayloadCollection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._HttpPayloadCollection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOHttpPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐHTTPPayloadCollectionInput(ctx context.Context, v interface{}) (*model.HTTPPayloadCollectionInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputHttpPayloadCollectionInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInstrumentationLibraryGlobalId2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationLibraryGlobalID) 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.marshalNInstrumentationLibraryGlobalId2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalID(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) unmarshalOInstrumentationLibraryGlobalIdInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDInputᚄ(ctx context.Context, v interface{}) ([]*model.InstrumentationLibraryGlobalIDInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.InstrumentationLibraryGlobalIDInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInstrumentationLibraryGlobalIdInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryGlobalIDInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInstrumentedApplicationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentedApplicationDetails(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentedApplicationDetails) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._InstrumentedApplicationDetails(ctx, sel, v) +} + +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) marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx context.Context, sel ast.SelectionSet, v *model.K8sActualNamespace) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8sActualNamespace(ctx, sel, v) +} + +func (ec *executionContext) marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sActualSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8sActualSource(ctx, sel, v) +} + +func (ec *executionContext) marshalOMessagingPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐMessagingPayloadCollection(ctx context.Context, sel ast.SelectionSet, v *model.MessagingPayloadCollection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._MessagingPayloadCollection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOMessagingPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐMessagingPayloadCollectionInput(ctx context.Context, v interface{}) (*model.MessagingPayloadCollectionInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMessagingPayloadCollectionInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOPayloadCollection2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPayloadCollection(ctx context.Context, sel ast.SelectionSet, v *model.PayloadCollection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PayloadCollection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOPayloadCollectionInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPayloadCollectionInput(ctx context.Context, v interface{}) (*model.PayloadCollectionInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputPayloadCollectionInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOPodWorkload2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PodWorkload) 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.marshalNPodWorkload2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkload(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) unmarshalOPodWorkloadInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadInputᚄ(ctx context.Context, v interface{}) ([]*model.PodWorkloadInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.PodWorkloadInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNPodWorkloadInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPodWorkloadInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOProgrammingLanguage2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐProgrammingLanguage(ctx context.Context, v interface{}) (*model.ProgrammingLanguage, error) { + if v == nil { + return nil, nil + } + var res = new(model.ProgrammingLanguage) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOProgrammingLanguage2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐProgrammingLanguage(ctx context.Context, sel ast.SelectionSet, v *model.ProgrammingLanguage) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOSourceContainerRuntimeDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetailsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SourceContainerRuntimeDetails) 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.marshalNSourceContainerRuntimeDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetails(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) unmarshalOSpanKind2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, v interface{}) (*model.SpanKind, error) { + if v == nil { + return nil, nil + } + var res = new(model.SpanKind) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOSpanKind2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, sel ast.SelectionSet, v *model.SpanKind) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +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 + } + 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.unmarshalOString2ᚖstring(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.marshalOString2ᚖstring(ctx, sel, v[i]) + } + + 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) 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/frontend/graph/model/destination.go b/frontend/graph/model/destination.go new file mode 100644 index 000000000..5f2890a08 --- /dev/null +++ b/frontend/graph/model/destination.go @@ -0,0 +1,48 @@ +package model + +import ( + "github.com/odigos-io/odigos/common" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type GetDestinationTypesResponse struct { + Categories []DestinationsCategory `json:"categories"` +} + +type DestinationTypesCategoryItem struct { + Type string `json:"type"` + DisplayName string `json:"display_name"` + ImageUrl string `json:"image_url"` + SupportedSignals SupportedSignals `json:"supported_signals"` + TestConnectionSupported bool `json:"test_connection_supported"` +} + +type SupportedSignals struct { + Traces ObservabilitySignalSupport `json:"traces"` + Metrics ObservabilitySignalSupport `json:"metrics"` + Logs ObservabilitySignalSupport `json:"logs"` +} + +type ObservabilitySignalSupport struct { + Supported bool `json:"supported"` +} +type DestinationsCategory struct { + Name string `json:"name"` + Items []DestinationTypesCategoryItem `json:"items"` +} + +type ExportedSignals struct { + Traces bool `json:"traces"` + Metrics bool `json:"metrics"` + Logs bool `json:"logs"` +} + +type Destination struct { + Id string `json:"id"` + Name string `json:"name"` + Type common.DestinationType `json:"type"` + ExportedSignals ExportedSignals `json:"signals"` + Fields string `json:"fields"` + DestinationType DestinationTypesCategoryItem `json:"destination_type"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} diff --git a/frontend/graph/model/models_gen.go b/frontend/graph/model/models_gen.go new file mode 100644 index 000000000..24f26f103 --- /dev/null +++ b/frontend/graph/model/models_gen.go @@ -0,0 +1,797 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +import ( + "fmt" + "io" + "strconv" +) + +type Action interface { + IsAction() + GetID() string + GetType() string + GetName() *string + GetNotes() *string + GetDisable() bool + GetSignals() []SignalType +} + +type ActionInput struct { + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details string `json:"details"` +} + +type AddClusterInfoAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details []*ClusterInfo `json:"details"` +} + +func (AddClusterInfoAction) IsAction() {} +func (this AddClusterInfoAction) GetID() string { return this.ID } +func (this AddClusterInfoAction) GetType() string { return this.Type } +func (this AddClusterInfoAction) GetName() *string { return this.Name } +func (this AddClusterInfoAction) GetNotes() *string { return this.Notes } +func (this AddClusterInfoAction) GetDisable() bool { return this.Disable } +func (this AddClusterInfoAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type ClusterInfo struct { + AttributeName string `json:"attributeName"` + AttributeStringValue *string `json:"attributeStringValue,omitempty"` +} + +type ComputePlatform struct { + ComputePlatformType ComputePlatformType `json:"computePlatformType"` + K8sActualNamespace *K8sActualNamespace `json:"k8sActualNamespace,omitempty"` + K8sActualNamespaces []*K8sActualNamespace `json:"k8sActualNamespaces"` + K8sActualSource *K8sActualSource `json:"k8sActualSource,omitempty"` + K8sActualSources []*K8sActualSource `json:"k8sActualSources"` + Destinations []*Destination `json:"destinations"` + Actions []*IcaInstanceResponse `json:"actions"` + InstrumentationRules []*InstrumentationRule `json:"instrumentationRules"` +} + +type Condition struct { + Type string `json:"type"` + Status ConditionStatus `json:"status"` + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +type DbQueryPayloadCollection struct { + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type DbQueryPayloadCollectionInput struct { + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type DeleteAttribute struct { + AttributeName string `json:"attributeName"` +} + +type DeleteAttributeAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details []string `json:"details"` +} + +func (DeleteAttributeAction) IsAction() {} +func (this DeleteAttributeAction) GetID() string { return this.ID } +func (this DeleteAttributeAction) GetType() string { return this.Type } +func (this DeleteAttributeAction) GetName() *string { return this.Name } +func (this DeleteAttributeAction) GetNotes() *string { return this.Notes } +func (this DeleteAttributeAction) GetDisable() bool { return this.Disable } +func (this DeleteAttributeAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type DestinationDetails struct { + Type string `json:"type"` + URLString string `json:"urlString"` + Fields string `json:"fields"` +} + +type DestinationInput struct { + Name string `json:"name"` + Type string `json:"type"` + ExportedSignals *ExportedSignalsInput `json:"exportedSignals"` + Fields []*FieldInput `json:"fields"` +} + +type ErrorSamplerAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details string `json:"details"` +} + +func (ErrorSamplerAction) IsAction() {} +func (this ErrorSamplerAction) GetID() string { return this.ID } +func (this ErrorSamplerAction) GetType() string { return this.Type } +func (this ErrorSamplerAction) GetName() *string { return this.Name } +func (this ErrorSamplerAction) GetNotes() *string { return this.Notes } +func (this ErrorSamplerAction) GetDisable() bool { return this.Disable } +func (this ErrorSamplerAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type ExportedSignalsInput struct { + Traces bool `json:"traces"` + Metrics bool `json:"metrics"` + Logs bool `json:"logs"` +} + +type Field struct { + Name string `json:"name"` + DisplayName string `json:"displayName"` + ComponentType string `json:"componentType"` + ComponentProperties string `json:"componentProperties"` + VideoURL *string `json:"videoUrl,omitempty"` + ThumbnailURL *string `json:"thumbnailURL,omitempty"` + InitialValue *string `json:"initialValue,omitempty"` +} + +type FieldInput struct { + Key string `json:"key"` + Value string `json:"value"` +} + +type GetConfigResponse struct { + Installation InstallationStatus `json:"installation"` +} + +type GetDestinationDetailsResponse struct { + Fields []*Field `json:"fields"` +} + +type HTTPPayloadCollection struct { + MimeTypes []*string `json:"mimeTypes,omitempty"` + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type HTTPPayloadCollectionInput struct { + MimeTypes []*string `json:"mimeTypes,omitempty"` + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type IcaInstanceResponse struct { + ID string `json:"id"` + Type string `json:"type"` + Spec string `json:"spec"` +} + +type InstrumentationLibrary struct { + LibraryName string `json:"libraryName"` + Options []*InstrumentationOption `json:"options"` +} + +type InstrumentationLibraryGlobalID struct { + Name string `json:"name"` + SpanKind *SpanKind `json:"spanKind,omitempty"` + Language *ProgrammingLanguage `json:"language,omitempty"` +} + +type InstrumentationLibraryGlobalIDInput struct { + Name string `json:"name"` + SpanKind *SpanKind `json:"spanKind,omitempty"` + Language *ProgrammingLanguage `json:"language,omitempty"` +} + +type InstrumentationOption struct { + OptionKey string `json:"optionKey"` + SpanKind SpanKind `json:"spanKind"` +} + +type InstrumentationRule struct { + RuleID string `json:"ruleId"` + RuleName *string `json:"ruleName,omitempty"` + Notes *string `json:"notes,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Workloads []*PodWorkload `json:"workloads,omitempty"` + InstrumentationLibraries []*InstrumentationLibraryGlobalID `json:"instrumentationLibraries,omitempty"` + PayloadCollection *PayloadCollection `json:"payloadCollection,omitempty"` +} + +type InstrumentationRuleInput struct { + RuleName *string `json:"ruleName,omitempty"` + Notes *string `json:"notes,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Workloads []*PodWorkloadInput `json:"workloads,omitempty"` + InstrumentationLibraries []*InstrumentationLibraryGlobalIDInput `json:"instrumentationLibraries,omitempty"` + PayloadCollection *PayloadCollectionInput `json:"payloadCollection,omitempty"` +} + +type InstrumentedApplicationDetails struct { + Containers []*SourceContainerRuntimeDetails `json:"containers,omitempty"` + Conditions []*Condition `json:"conditions,omitempty"` + InstrumentationOptions []*InstrumentationLibrary `json:"instrumentationOptions"` +} + +type K8sActualNamespace struct { + Name string `json:"name"` + InstrumentationLabelEnabled *bool `json:"instrumentationLabelEnabled,omitempty"` + K8sActualSources []*K8sActualSource `json:"k8sActualSources"` +} + +type K8sActualSource struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` + ServiceName *string `json:"serviceName,omitempty"` + NumberOfInstances *int `json:"numberOfInstances,omitempty"` + ReportedName *string `json:"reportedName,omitempty"` + AutoInstrumented bool `json:"autoInstrumented"` + AutoInstrumentedDecision string `json:"autoInstrumentedDecision"` + InstrumentedApplicationDetails *InstrumentedApplicationDetails `json:"instrumentedApplicationDetails,omitempty"` +} + +type K8sDesiredNamespaceInput struct { + AutoInstrument *bool `json:"autoInstrument,omitempty"` +} + +type K8sDesiredSourceInput struct { + ServiceName *string `json:"serviceName,omitempty"` + AutoInstrument *bool `json:"autoInstrument,omitempty"` +} + +type K8sNamespaceID struct { + Name string `json:"name"` +} + +type K8sSourceID struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` +} + +type LatencySamplerAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details []*string `json:"details"` +} + +func (LatencySamplerAction) IsAction() {} +func (this LatencySamplerAction) GetID() string { return this.ID } +func (this LatencySamplerAction) GetType() string { return this.Type } +func (this LatencySamplerAction) GetName() *string { return this.Name } +func (this LatencySamplerAction) GetNotes() *string { return this.Notes } +func (this LatencySamplerAction) GetDisable() bool { return this.Disable } +func (this LatencySamplerAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type MessagingPayloadCollection struct { + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type MessagingPayloadCollectionInput struct { + MaxPayloadLength *int `json:"maxPayloadLength,omitempty"` + DropPartialPayloads *bool `json:"dropPartialPayloads,omitempty"` +} + +type Mutation struct { +} + +type OverviewMetricsResponse struct { + Sources []*SingleSourceMetricsResponse `json:"sources"` + Destinations []*SingleDestinationMetricsResponse `json:"destinations"` +} + +type PatchSourceRequestInput struct { + ReportedName *string `json:"reportedName,omitempty"` +} + +type PayloadCollection struct { + HTTPRequest *HTTPPayloadCollection `json:"httpRequest,omitempty"` + HTTPResponse *HTTPPayloadCollection `json:"httpResponse,omitempty"` + DbQuery *DbQueryPayloadCollection `json:"dbQuery,omitempty"` + Messaging *MessagingPayloadCollection `json:"messaging,omitempty"` +} + +type PayloadCollectionInput struct { + HTTPRequest *HTTPPayloadCollectionInput `json:"httpRequest,omitempty"` + HTTPResponse *HTTPPayloadCollectionInput `json:"httpResponse,omitempty"` + DbQuery *DbQueryPayloadCollectionInput `json:"dbQuery,omitempty"` + Messaging *MessagingPayloadCollectionInput `json:"messaging,omitempty"` +} + +type PersistNamespaceItemInput struct { + Name string `json:"name"` + FutureSelected *bool `json:"futureSelected,omitempty"` +} + +type PersistNamespaceSourceInput struct { + Name string `json:"name"` + Kind K8sResourceKind `json:"kind"` + Selected *bool `json:"selected,omitempty"` +} + +type PiiMaskingAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details []string `json:"details,omitempty"` +} + +func (PiiMaskingAction) IsAction() {} +func (this PiiMaskingAction) GetID() string { return this.ID } +func (this PiiMaskingAction) GetType() string { return this.Type } +func (this PiiMaskingAction) GetName() *string { return this.Name } +func (this PiiMaskingAction) GetNotes() *string { return this.Notes } +func (this PiiMaskingAction) GetDisable() bool { return this.Disable } +func (this PiiMaskingAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type PodWorkload struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` +} + +type PodWorkloadInput struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` +} + +type ProbabilisticSamplerAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details string `json:"details"` +} + +func (ProbabilisticSamplerAction) IsAction() {} +func (this ProbabilisticSamplerAction) GetID() string { return this.ID } +func (this ProbabilisticSamplerAction) GetType() string { return this.Type } +func (this ProbabilisticSamplerAction) GetName() *string { return this.Name } +func (this ProbabilisticSamplerAction) GetNotes() *string { return this.Notes } +func (this ProbabilisticSamplerAction) GetDisable() bool { return this.Disable } +func (this ProbabilisticSamplerAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type Query struct { +} + +type RenameAttributeAction struct { + ID string `json:"id"` + Type string `json:"type"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Disable bool `json:"disable"` + Signals []SignalType `json:"signals"` + Details string `json:"details"` +} + +func (RenameAttributeAction) IsAction() {} +func (this RenameAttributeAction) GetID() string { return this.ID } +func (this RenameAttributeAction) GetType() string { return this.Type } +func (this RenameAttributeAction) GetName() *string { return this.Name } +func (this RenameAttributeAction) GetNotes() *string { return this.Notes } +func (this RenameAttributeAction) GetDisable() bool { return this.Disable } +func (this RenameAttributeAction) GetSignals() []SignalType { + if this.Signals == nil { + return nil + } + interfaceSlice := make([]SignalType, 0, len(this.Signals)) + for _, concrete := range this.Signals { + interfaceSlice = append(interfaceSlice, concrete) + } + return interfaceSlice +} + +type SingleDestinationMetricsResponse struct { + ID string `json:"id"` + TotalDataSent int `json:"totalDataSent"` + Throughput int `json:"throughput"` +} + +type SingleSourceMetricsResponse struct { + Namespace string `json:"namespace"` + Kind string `json:"kind"` + Name string `json:"name"` + TotalDataSent int `json:"totalDataSent"` + Throughput int `json:"throughput"` +} + +type SourceContainerRuntimeDetails struct { + ContainerName string `json:"containerName"` + Language string `json:"language"` +} + +type TestConnectionResponse struct { + Succeeded bool `json:"succeeded"` + StatusCode int `json:"statusCode"` + DestinationType *string `json:"destinationType,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type ComputePlatformType string + +const ( + ComputePlatformTypeK8s ComputePlatformType = "K8S" + ComputePlatformTypeVM ComputePlatformType = "VM" +) + +var AllComputePlatformType = []ComputePlatformType{ + ComputePlatformTypeK8s, + ComputePlatformTypeVM, +} + +func (e ComputePlatformType) IsValid() bool { + switch e { + case ComputePlatformTypeK8s, ComputePlatformTypeVM: + return true + } + return false +} + +func (e ComputePlatformType) String() string { + return string(e) +} + +func (e *ComputePlatformType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ComputePlatformType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ComputePlatformType", str) + } + return nil +} + +func (e ComputePlatformType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type ConditionStatus string + +const ( + ConditionStatusTrue ConditionStatus = "True" + ConditionStatusFalse ConditionStatus = "False" + ConditionStatusUnknown ConditionStatus = "Unknown" +) + +var AllConditionStatus = []ConditionStatus{ + ConditionStatusTrue, + ConditionStatusFalse, + ConditionStatusUnknown, +} + +func (e ConditionStatus) IsValid() bool { + switch e { + case ConditionStatusTrue, ConditionStatusFalse, ConditionStatusUnknown: + return true + } + return false +} + +func (e ConditionStatus) String() string { + return string(e) +} + +func (e *ConditionStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ConditionStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ConditionStatus", str) + } + return nil +} + +func (e ConditionStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type InstallationStatus string + +const ( + InstallationStatusNew InstallationStatus = "NEW" + InstallationStatusAppsSelected InstallationStatus = "APPS_SELECTED" + InstallationStatusFinished InstallationStatus = "FINISHED" +) + +var AllInstallationStatus = []InstallationStatus{ + InstallationStatusNew, + InstallationStatusAppsSelected, + InstallationStatusFinished, +} + +func (e InstallationStatus) IsValid() bool { + switch e { + case InstallationStatusNew, InstallationStatusAppsSelected, InstallationStatusFinished: + return true + } + return false +} + +func (e InstallationStatus) String() string { + return string(e) +} + +func (e *InstallationStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = InstallationStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid InstallationStatus", str) + } + return nil +} + +func (e InstallationStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sResourceKind string + +const ( + K8sResourceKindDeployment K8sResourceKind = "Deployment" + K8sResourceKindDaemonSet K8sResourceKind = "DaemonSet" + K8sResourceKindStatefulSet K8sResourceKind = "StatefulSet" +) + +var AllK8sResourceKind = []K8sResourceKind{ + K8sResourceKindDeployment, + K8sResourceKindDaemonSet, + K8sResourceKindStatefulSet, +} + +func (e K8sResourceKind) IsValid() bool { + switch e { + case K8sResourceKindDeployment, K8sResourceKindDaemonSet, K8sResourceKindStatefulSet: + return true + } + return false +} + +func (e K8sResourceKind) String() string { + return string(e) +} + +func (e *K8sResourceKind) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sResourceKind(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8sResourceKind", str) + } + return nil +} + +func (e K8sResourceKind) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type ProgrammingLanguage string + +const ( + ProgrammingLanguageUnspecified ProgrammingLanguage = "Unspecified" + ProgrammingLanguageJava ProgrammingLanguage = "Java" + ProgrammingLanguageGo ProgrammingLanguage = "Go" + ProgrammingLanguageJavaScript ProgrammingLanguage = "JavaScript" + ProgrammingLanguagePython ProgrammingLanguage = "Python" + ProgrammingLanguageDotNet ProgrammingLanguage = "DotNet" +) + +var AllProgrammingLanguage = []ProgrammingLanguage{ + ProgrammingLanguageUnspecified, + ProgrammingLanguageJava, + ProgrammingLanguageGo, + ProgrammingLanguageJavaScript, + ProgrammingLanguagePython, + ProgrammingLanguageDotNet, +} + +func (e ProgrammingLanguage) IsValid() bool { + switch e { + case ProgrammingLanguageUnspecified, ProgrammingLanguageJava, ProgrammingLanguageGo, ProgrammingLanguageJavaScript, ProgrammingLanguagePython, ProgrammingLanguageDotNet: + return true + } + return false +} + +func (e ProgrammingLanguage) String() string { + return string(e) +} + +func (e *ProgrammingLanguage) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ProgrammingLanguage(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ProgrammingLanguage", str) + } + return nil +} + +func (e ProgrammingLanguage) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type SignalType string + +const ( + SignalTypeTraces SignalType = "TRACES" + SignalTypeMetrics SignalType = "METRICS" + SignalTypeLogs SignalType = "LOGS" +) + +var AllSignalType = []SignalType{ + SignalTypeTraces, + SignalTypeMetrics, + SignalTypeLogs, +} + +func (e SignalType) IsValid() bool { + switch e { + case SignalTypeTraces, SignalTypeMetrics, SignalTypeLogs: + return true + } + return false +} + +func (e SignalType) String() string { + return string(e) +} + +func (e *SignalType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = SignalType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid SignalType", str) + } + return nil +} + +func (e SignalType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type SpanKind string + +const ( + SpanKindInternal SpanKind = "Internal" + SpanKindServer SpanKind = "Server" + SpanKindClient SpanKind = "Client" + SpanKindProducer SpanKind = "Producer" + SpanKindConsumer SpanKind = "Consumer" +) + +var AllSpanKind = []SpanKind{ + SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer, +} + +func (e SpanKind) IsValid() bool { + switch e { + case SpanKindInternal, SpanKindServer, SpanKindClient, SpanKindProducer, SpanKindConsumer: + return true + } + return false +} + +func (e SpanKind) String() string { + return string(e) +} + +func (e *SpanKind) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = SpanKind(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid SpanKind", str) + } + return nil +} + +func (e SpanKind) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/frontend/graph/resolver.go b/frontend/graph/resolver.go new file mode 100644 index 000000000..9521df8e2 --- /dev/null +++ b/frontend/graph/resolver.go @@ -0,0 +1,12 @@ +package graph + +import ( + collectormetrics "github.com/odigos-io/odigos/frontend/endpoints/collector_metrics" +) + +// This file will not be regenerated automatically. +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct { + MetricsConsumer *collectormetrics.OdigosMetricsConsumer +} diff --git a/frontend/graph/schema.graphqls b/frontend/graph/schema.graphqls new file mode 100644 index 000000000..8d3d231ae --- /dev/null +++ b/frontend/graph/schema.graphqls @@ -0,0 +1,484 @@ +enum ComputePlatformType { + K8S + VM +} + +enum K8sResourceKind { + Deployment + DaemonSet + StatefulSet +} + +enum ConditionStatus { + True + False + Unknown +} + +enum ProgrammingLanguage { + Unspecified + Java + Go + JavaScript + Python + DotNet +} + +enum SignalType { + TRACES + METRICS + LOGS +} + +enum SpanKind { + Internal + Server + Client + Producer + Consumer +} + +enum InstallationStatus { + NEW + APPS_SELECTED + FINISHED +} + +type SourceContainerRuntimeDetails { + containerName: String! + language: String! +} + +type InstrumentationOption { + optionKey: String! + spanKind: SpanKind! +} + +type InstrumentationLibrary { + libraryName: String! + options: [InstrumentationOption!]! +} + +type InstrumentedApplicationDetails { + containers: [SourceContainerRuntimeDetails!] + conditions: [Condition!] + instrumentationOptions: [InstrumentationLibrary!]! +} + +type Condition { + type: String! + status: ConditionStatus! + lastTransitionTime: String + reason: String + message: String +} + +type K8sActualNamespace { + name: String! + instrumentationLabelEnabled: Boolean + k8sActualSources(instrumentationLabeled: Boolean): [K8sActualSource]! +} + +input K8sDesiredNamespaceInput { + autoInstrument: Boolean +} + +input K8sNamespaceId { + name: String! +} + +type K8sActualSource { + namespace: String! + kind: K8sResourceKind! + name: String! + serviceName: String + numberOfInstances: Int + reportedName: String + autoInstrumented: Boolean! + autoInstrumentedDecision: String! + instrumentedApplicationDetails: InstrumentedApplicationDetails +} + +input K8sDesiredSourceInput { + serviceName: String + autoInstrument: Boolean +} + +type PodWorkload { + namespace: String! + kind: K8sResourceKind! + name: String! +} + +input PodWorkloadInput { + namespace: String! + kind: K8sResourceKind! + name: String! +} + +input K8sSourceId { + namespace: String! + kind: K8sResourceKind! + name: String! +} + +type InstrumentationRule { + ruleId: ID! + ruleName: String + notes: String + disabled: Boolean + workloads: [PodWorkload!] + instrumentationLibraries: [InstrumentationLibraryGlobalId!] + payloadCollection: PayloadCollection +} + +input InstrumentationRuleInput { + ruleName: String + notes: String + disabled: Boolean + workloads: [PodWorkloadInput!] + instrumentationLibraries: [InstrumentationLibraryGlobalIdInput!] + payloadCollection: PayloadCollectionInput +} + +type InstrumentationLibraryGlobalId { + name: String! + spanKind: SpanKind + language: ProgrammingLanguage +} + +input InstrumentationLibraryGlobalIdInput { + name: String! + spanKind: SpanKind + language: ProgrammingLanguage +} + +type PayloadCollection { + httpRequest: HttpPayloadCollection + httpResponse: HttpPayloadCollection + dbQuery: DbQueryPayloadCollection + messaging: MessagingPayloadCollection +} + +input PayloadCollectionInput { + httpRequest: HttpPayloadCollectionInput + httpResponse: HttpPayloadCollectionInput + dbQuery: DbQueryPayloadCollectionInput + messaging: MessagingPayloadCollectionInput +} + +type HttpPayloadCollection { + mimeTypes: [String] + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +input HttpPayloadCollectionInput { + mimeTypes: [String] + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +type DbQueryPayloadCollection { + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +input DbQueryPayloadCollectionInput { + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +type MessagingPayloadCollection { + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +input MessagingPayloadCollectionInput { + maxPayloadLength: Int + dropPartialPayloads: Boolean +} + +type ComputePlatform { + computePlatformType: ComputePlatformType! + k8sActualNamespace(name: String!): K8sActualNamespace + k8sActualNamespaces: [K8sActualNamespace]! + k8sActualSource( + name: String + namespace: String + kind: String + ): K8sActualSource + k8sActualSources: [K8sActualSource]! + destinations: [Destination!]! + actions: [IcaInstanceResponse!]! + instrumentationRules: [InstrumentationRule!]! +} + +type SupportedSignals { + traces: ObservabilitySignalSupport! + metrics: ObservabilitySignalSupport! + logs: ObservabilitySignalSupport! +} + +type ObservabilitySignalSupport { + supported: Boolean! +} + +type DestinationTypesCategoryItem { + type: String! + displayName: String! + imageUrl: String! + supportedSignals: SupportedSignals! + testConnectionSupported: Boolean! +} + +type DestinationsCategory { + name: String! + items: [DestinationTypesCategoryItem!]! +} + +type GetDestinationTypesResponse { + categories: [DestinationsCategory!]! +} + +type ExportedSignals { + traces: Boolean! + metrics: Boolean! + logs: Boolean! +} + +type Destination { + id: ID! + name: String! + type: String! + exportedSignals: ExportedSignals! + fields: String! + destinationType: DestinationTypesCategoryItem! + conditions: [Condition!] +} + +type GetConfigResponse { + installation: InstallationStatus! +} + +type Field { + name: String! + displayName: String! + componentType: String! + componentProperties: String! # Using String to store JSON data as a string + videoUrl: String + thumbnailURL: String + initialValue: String +} + +type GetDestinationDetailsResponse { + fields: [Field!]! +} + +input DestinationInput { + name: String! + type: String! + exportedSignals: ExportedSignalsInput! + fields: [FieldInput!]! +} + +input FieldInput { + key: String! + value: String! +} + +input ExportedSignalsInput { + traces: Boolean! + metrics: Boolean! + logs: Boolean! +} + +input PersistNamespaceItemInput { + name: String! + futureSelected: Boolean +} + +input PersistNamespaceSourceInput { + name: String! + kind: K8sResourceKind! + selected: Boolean +} + +type TestConnectionResponse { + succeeded: Boolean! + statusCode: Int! + destinationType: String + message: String + reason: String +} + +type DestinationDetails { + type: String! + urlString: String! + fields: String! +} + +type IcaInstanceResponse { + id: String! + type: String! + spec: String! +} + +input PatchSourceRequestInput { + reportedName: String +} + +interface Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! +} + +type ClusterInfo { + attributeName: String! + attributeStringValue: String +} + +type AddClusterInfoAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: [ClusterInfo!]! +} + +type DeleteAttribute { + attributeName: String! +} + +type DeleteAttributeAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: [String!]! +} + +type PiiMaskingAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: [String!] +} + +type ErrorSamplerAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: String! +} + +type LatencySamplerAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: [String]! +} + +type ProbabilisticSamplerAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: String! +} + +type RenameAttributeAction implements Action { + id: ID! + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: String! +} + +input ActionInput { + type: String! + name: String + notes: String + disable: Boolean! + signals: [SignalType!]! + details: String! +} + +type OverviewMetricsResponse { + sources: [SingleSourceMetricsResponse!]! + destinations: [SingleDestinationMetricsResponse!]! +} + +type SingleSourceMetricsResponse { + namespace: String! + kind: String! + name: String! + totalDataSent: Int! + throughput: Int! +} + +type SingleDestinationMetricsResponse { + id: String! + totalDataSent: Int! + throughput: Int! +} + +type Query { + computePlatform: ComputePlatform + config: GetConfigResponse + destinationTypes: GetDestinationTypesResponse + destinationTypeDetails(type: String!): GetDestinationDetailsResponse + potentialDestinations: [DestinationDetails!]! + getOverviewMetrics: OverviewMetricsResponse! +} + +type Mutation { + createNewDestination(destination: DestinationInput!): Destination! + persistK8sNamespace(namespace: PersistNamespaceItemInput!): Boolean! + persistK8sSources( + namespace: String! + sources: [PersistNamespaceSourceInput!]! + ): Boolean! + testConnectionForDestination( + destination: DestinationInput! + ): TestConnectionResponse! + updateK8sActualSource( + sourceId: K8sSourceId! + patchSourceRequest: PatchSourceRequestInput! + ): Boolean! + updateDestination(id: ID!, destination: DestinationInput!): Destination! + deleteDestination(id: ID!): Boolean! + createAction(action: ActionInput!): Action! + updateAction(id: ID!, action: ActionInput!): Action! + deleteAction(id: ID!, actionType: String!): Boolean! + + createInstrumentationRule( + instrumentationRule: InstrumentationRuleInput! + ): InstrumentationRule! + updateInstrumentationRule( + ruleId: ID! + instrumentationRule: InstrumentationRuleInput! + ): InstrumentationRule! + deleteInstrumentationRule(ruleId: ID!): Boolean! +} diff --git a/frontend/graph/schema.resolvers.go b/frontend/graph/schema.resolvers.go new file mode 100644 index 000000000..edcf25b4d --- /dev/null +++ b/frontend/graph/schema.resolvers.go @@ -0,0 +1,838 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.49 + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + actionservices "github.com/odigos-io/odigos/frontend/services/actions" + testconnection "github.com/odigos-io/odigos/frontend/services/test_connection" + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +// K8sActualNamespace is the resolver for the k8sActualNamespace field. +func (r *computePlatformResolver) K8sActualNamespace(ctx context.Context, obj *model.ComputePlatform, name string) (*model.K8sActualNamespace, error) { + namespaceActualSources, err := services.GetWorkloadsInNamespace(ctx, name, nil) + if err != nil { + return nil, err + } + + // Convert namespaceActualSources to []*model.K8sActualSource + namespaceActualSourcesPointers := make([]*model.K8sActualSource, len(namespaceActualSources)) + for i, source := range namespaceActualSources { + namespaceActualSourcesPointers[i] = &source + } + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + nsInstrumented := workload.GetInstrumentationLabelValue(namespace.GetLabels()) + + return &model.K8sActualNamespace{ + Name: name, + InstrumentationLabelEnabled: nsInstrumented, + K8sActualSources: namespaceActualSourcesPointers, + }, nil +} + +// K8sActualNamespaces is the resolver for the k8sActualNamespaces field. +func (r *computePlatformResolver) K8sActualNamespaces(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualNamespace, error) { + namespacesResponse := services.GetK8SNamespaces(ctx) + + K8sActualNamespaces := make([]*model.K8sActualNamespace, len(namespacesResponse.Namespaces)) + for i, namespace := range namespacesResponse.Namespaces { + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, namespace.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + nsInstrumented := workload.GetInstrumentationLabelValue(namespace.GetLabels()) + + K8sActualNamespaces[i] = &model.K8sActualNamespace{ + Name: namespace.Name, + InstrumentationLabelEnabled: nsInstrumented, + } + } + + return K8sActualNamespaces, nil +} + +// K8sActualSource is the resolver for the k8sActualSource field. +func (r *computePlatformResolver) K8sActualSource(ctx context.Context, obj *model.ComputePlatform, name *string, namespace *string, kind *string) (*model.K8sActualSource, error) { + source, err := services.GetActualSource(ctx, *namespace, *kind, *name) + if err != nil { + return nil, err + } + if source == nil { + return nil, nil + } + k8sActualSource := k8sSourceToGql(source) + + return k8sActualSource, nil +} + +// K8sActualSources is the resolver for the k8sActualSources field. +func (r *computePlatformResolver) K8sActualSources(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualSource, error) { + instrumentedApplications, err := kube.DefaultClient.OdigosClient.InstrumentedApplications("").List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + + // Initialize an empty list of K8sActualSource + var actualSources []*model.K8sActualSource + + // Convert each instrumented application to the K8sActualSource type + for _, app := range instrumentedApplications.Items { + actualSource := instrumentedApplicationToActualSource(app) + + owner, _ := services.GetWorkload(ctx, actualSource.Namespace, string(actualSource.Kind), actualSource.Name) + if owner == nil { + + continue + } + ownerAnnotations := owner.GetAnnotations() + var reportedName string + if ownerAnnotations != nil { + reportedName = ownerAnnotations[consts.OdigosReportedNameAnnotation] + } + actualSource.ReportedName = &reportedName + actualSources = append(actualSources, actualSource) + } + + return actualSources, nil +} + +// Destinations is the resolver for the destinations field. +func (r *computePlatformResolver) Destinations(ctx context.Context, obj *model.ComputePlatform) ([]*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + dests, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + + var destinations []*model.Destination + for _, dest := range dests.Items { + secretFields, err := services.GetDestinationSecretFields(ctx, odigosns, &dest) + if err != nil { + return nil, err + } + + // Convert the k8s destination format to the expected endpoint format + endpointDest := services.K8sDestinationToEndpointFormat(dest, secretFields) + destinations = append(destinations, &endpointDest) + } + + return destinations, nil +} + +// Actions is the resolver for the actions field. +func (r *computePlatformResolver) Actions(ctx context.Context, obj *model.ComputePlatform) ([]*model.IcaInstanceResponse, error) { + var response []*model.IcaInstanceResponse + odigosns := consts.DefaultOdigosNamespace + + // AddClusterInfos actions + icaActions, err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range icaActions.Items { + specStr, err := json.Marshal(action.Spec) // Convert spec to JSON string + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), // Return the JSON string + }) + } + + // DeleteAttributes actions + daActions, err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range daActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // RenameAttributes actions + raActions, err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range raActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // ErrorSamplers actions + esActions, err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range esActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // LatencySamplers actions + lsActions, err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range lsActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // ProbabilisticSamplers actions + psActions, err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range psActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // PiiMaskings actions + piActions, err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range piActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + return response, nil +} + +// InstrumentationRules is the resolver for the instrumentationRules field. +func (r *computePlatformResolver) InstrumentationRules(ctx context.Context, obj *model.ComputePlatform) ([]*model.InstrumentationRule, error) { + return services.ListInstrumentationRules(ctx) +} + +// Type is the resolver for the type field. +func (r *destinationResolver) Type(ctx context.Context, obj *model.Destination) (string, error) { + return string(obj.Type), nil +} + +// Conditions is the resolver for the conditions field. +func (r *destinationResolver) Conditions(ctx context.Context, obj *model.Destination) ([]*model.Condition, error) { + + conditions := make([]*model.Condition, 0, len(obj.Conditions)) + for _, c := range obj.Conditions { + // Convert LastTransitionTime to a string pointer if it's not nil + var lastTransitionTime *string + if !c.LastTransitionTime.IsZero() { + t := c.LastTransitionTime.Format(time.RFC3339) + lastTransitionTime = &t + } + + // Add the converted Condition to the list + conditions = append(conditions, &model.Condition{ + Type: c.Type, + Status: model.ConditionStatus(c.Status), + LastTransitionTime: lastTransitionTime, + Reason: &c.Reason, + Message: &c.Message, + }) + } + return conditions, nil +} + +// K8sActualSources is the resolver for the k8sActualSources field. +func (r *k8sActualNamespaceResolver) K8sActualSources(ctx context.Context, obj *model.K8sActualNamespace, instrumentationLabeled *bool) ([]*model.K8sActualSource, error) { + namespaceActualSources, err := services.GetWorkloadsInNamespace(ctx, obj.Name, instrumentationLabeled) + if err != nil { + return nil, err + } + + // Convert namespaceActualSources to []*model.K8sActualSource + namespaceActualSourcesPointers := make([]*model.K8sActualSource, len(namespaceActualSources)) + for i, source := range namespaceActualSources { + namespaceActualSourcesPointers[i] = &source + } + + return namespaceActualSourcesPointers, nil +} + +// CreateNewDestination is the resolver for the createNewDestination field. +func (r *mutationResolver) CreateNewDestination(ctx context.Context, destination model.DestinationInput) (*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + + destType := common.DestinationType(destination.Type) + destName := destination.Name + + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found", destType) + } + + // Convert fields to map[string]string + fieldsMap := make(map[string]string) + for _, field := range destination.Fields { + fieldsMap[field.Key] = field.Value + } + + errors := services.VerifyDestinationDataScheme(destType, destTypeConfig, fieldsMap) + if len(errors) > 0 { + return nil, fmt.Errorf("invalid destination data scheme: %v", errors) + } + + dataField, secretFields := services.TransformFieldsToDataAndSecrets(destTypeConfig, fieldsMap) + generateNamePrefix := "odigos.io.dest." + string(destType) + "-" + + k8sDestination := v1alpha1.Destination{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: generateNamePrefix, + }, + Spec: v1alpha1.DestinationSpec{ + Type: destType, + DestinationName: destName, + Data: dataField, + Signals: services.ExportedSignalsObjectToSlice(destination.ExportedSignals), + }, + } + + createSecret := len(secretFields) > 0 + if createSecret { + secretRef, err := services.CreateDestinationSecret(ctx, destType, secretFields, odigosns) + if err != nil { + return nil, err + } + k8sDestination.Spec.SecretRef = secretRef + } + + dest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Create(ctx, &k8sDestination, metav1.CreateOptions{}) + if err != nil { + if createSecret { + kube.DefaultClient.CoreV1().Secrets(odigosns).Delete(ctx, destName, metav1.DeleteOptions{}) + } + return nil, err + } + + if dest.Spec.SecretRef != nil { + err = services.AddDestinationOwnerReferenceToSecret(ctx, odigosns, dest) + if err != nil { + return nil, err + } + } + + secretFieldsMap, err := services.GetDestinationSecretFields(ctx, odigosns, dest) + if err != nil { + return nil, err + } + + endpointDest := services.K8sDestinationToEndpointFormat(*dest, secretFieldsMap) + return &endpointDest, nil +} + +// PersistK8sNamespace is the resolver for the persistK8sNamespace field. +func (r *mutationResolver) PersistK8sNamespace(ctx context.Context, namespace model.PersistNamespaceItemInput) (bool, error) { + jsonMergePayload := services.GetJsonMergePatchForInstrumentationLabel(namespace.FutureSelected) + _, err := kube.DefaultClient.CoreV1().Namespaces().Patch(ctx, namespace.Name, types.MergePatchType, jsonMergePayload, metav1.PatchOptions{}) + if err != nil { + return false, fmt.Errorf("failed to patch namespace: %v", err) + } + + return true, nil +} + +// PersistK8sSources is the resolver for the persistK8sSources field. +func (r *mutationResolver) PersistK8sSources(ctx context.Context, namespace string, sources []*model.PersistNamespaceSourceInput) (bool, error) { + var persistObjects []model.PersistNamespaceSourceInput + for _, source := range sources { + persistObjects = append(persistObjects, model.PersistNamespaceSourceInput{ + Name: source.Name, + Kind: source.Kind, + Selected: source.Selected, + }) + } + + err := services.SyncWorkloadsInNamespace(ctx, namespace, persistObjects) + if err != nil { + return false, fmt.Errorf("failed to sync workloads: %v", err) + } + + return true, nil +} + +// TestConnectionForDestination is the resolver for the testConnectionForDestination field. +func (r *mutationResolver) TestConnectionForDestination(ctx context.Context, destination model.DestinationInput) (*model.TestConnectionResponse, error) { + destType := common.DestinationType(destination.Type) + + destConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, err + } + + if !destConfig.Spec.TestConnectionSupported { + return nil, fmt.Errorf("destination type %s does not support test connection", destination.Type) + } + + configurer, err := testconnection.ConvertDestinationToConfigurer(destination) + if err != nil { + return nil, err + } + + res := testconnection.TestConnection(ctx, configurer) + if !res.Succeeded { + return &model.TestConnectionResponse{ + Succeeded: false, + StatusCode: res.StatusCode, + DestinationType: (*string)(&res.DestinationType), + Message: &res.Message, + Reason: (*string)(&res.Reason), + }, nil + } + + return &model.TestConnectionResponse{ + Succeeded: true, + StatusCode: 200, + DestinationType: (*string)(&res.DestinationType), + }, nil +} + +// UpdateK8sActualSource is the resolver for the updateK8sActualSource field. +func (r *mutationResolver) UpdateK8sActualSource(ctx context.Context, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) (bool, error) { + ns := sourceID.Namespace + kind := string(sourceID.Kind) + name := sourceID.Name + + request := patchSourceRequest + + // Handle ReportedName update + if request.ReportedName != nil { + if err := services.UpdateReportedName(ctx, ns, kind, name, *request.ReportedName); err != nil { + return false, err + } + } + + return true, nil +} + +// UpdateDestination is the resolver for the updateDestination field. +func (r *mutationResolver) UpdateDestination(ctx context.Context, id string, destination model.DestinationInput) (*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + + destType := common.DestinationType(destination.Type) + destName := destination.Name + + // Get the destination type configuration + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found: %v", destType, err) + } + + // Convert fields from input to map[string]string + fields := make(map[string]string) + for _, field := range destination.Fields { + fields[field.Key] = field.Value + } + + // Validate the destination data schema + validationErrors := services.VerifyDestinationDataScheme(destType, destTypeConfig, fields) + if len(validationErrors) > 0 { + var errMsg string + for _, e := range validationErrors { + errMsg += e.Error() + "; " + } + return nil, fmt.Errorf("validation errors: %s", errMsg) + } + + // Separate data fields and secret fields + dataFields, secretFields := services.TransformFieldsToDataAndSecrets(destTypeConfig, fields) + + // Retrieve the existing destination + dest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get destination: %v", err) + } + + // Handle secrets + destUpdateHasSecrets := len(secretFields) > 0 + destCurrentlyHasSecrets := dest.Spec.SecretRef != nil + + if !destUpdateHasSecrets && destCurrentlyHasSecrets { + // Delete the secret if it's not needed anymore + err := kube.DefaultClient.CoreV1().Secrets(odigosns).Delete(ctx, dest.Spec.SecretRef.Name, metav1.DeleteOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to delete secret: %v", err) + } + dest.Spec.SecretRef = nil + } else if destUpdateHasSecrets && !destCurrentlyHasSecrets { + // Create the secret if it was added in this update + secretRef, err := services.CreateDestinationSecret(ctx, destType, secretFields, odigosns) + if err != nil { + return nil, fmt.Errorf("failed to create secret: %v", err) + } + dest.Spec.SecretRef = secretRef + // Add owner reference to the secret + err = services.AddDestinationOwnerReferenceToSecret(ctx, odigosns, dest) + if err != nil { + return nil, fmt.Errorf("failed to add owner reference to secret: %v", err) + } + } else if destUpdateHasSecrets && destCurrentlyHasSecrets { + // Update the secret in case it is modified + secret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Get(ctx, dest.Spec.SecretRef.Name, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get secret: %v", err) + } + origSecret := secret.DeepCopy() + + secret.StringData = secretFields + _, err = kube.DefaultClient.CoreV1().Secrets(odigosns).Update(ctx, secret, metav1.UpdateOptions{}) + if err != nil { + // Rollback secret if needed + _, rollbackErr := kube.DefaultClient.CoreV1().Secrets(odigosns).Update(ctx, origSecret, metav1.UpdateOptions{}) + if rollbackErr != nil { + fmt.Printf("Failed to rollback secret: %v\n", rollbackErr) + } + return nil, fmt.Errorf("failed to update secret: %v", err) + } + } + + // Update the destination specification + dest.Spec.Type = destType + dest.Spec.DestinationName = destName + dest.Spec.Data = dataFields + dest.Spec.Signals = services.ExportedSignalsObjectToSlice(destination.ExportedSignals) + + // Update the destination in Kubernetes + updatedDest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Update(ctx, dest, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update destination: %v", err) + } + + // Get the secret fields for the updated destination + secretFields, err = services.GetDestinationSecretFields(ctx, odigosns, updatedDest) + if err != nil { + return nil, fmt.Errorf("failed to get secret fields: %v", err) + } + + // Convert the updated destination to the GraphQL model + resp := services.K8sDestinationToEndpointFormat(*updatedDest, secretFields) + + return &resp, nil +} + +// DeleteDestination is the resolver for the deleteDestination field. +func (r *mutationResolver) DeleteDestination(ctx context.Context, id string) (bool, error) { + odigosns := consts.DefaultOdigosNamespace + err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + + if err != nil { + return false, fmt.Errorf("failed to delete destination: %w", err) + } + + return true, nil +} + +// CreateAction is the resolver for the createAction field. +func (r *mutationResolver) CreateAction(ctx context.Context, action model.ActionInput) (model.Action, error) { + switch action.Type { + case actionservices.ActionTypeAddClusterInfo: + return actionservices.CreateAddClusterInfo(ctx, action) + case actionservices.ActionTypeDeleteAttribute: + return actionservices.CreateDeleteAttribute(ctx, action) + case actionservices.ActionTypePiiMasking: + return actionservices.CreatePiiMasking(ctx, action) + case actionservices.ActionTypeErrorSampler: + return actionservices.CreateErrorSampler(ctx, action) + case actionservices.ActionTypeLatencySampler: + return actionservices.CreateLatencySampler(ctx, action) + case actionservices.ActionTypeProbabilisticSampler: + return actionservices.CreateProbabilisticSampler(ctx, action) + case actionservices.ActionTypeRenameAttribute: + return actionservices.CreateRenameAttribute(ctx, action) + default: + return nil, fmt.Errorf("unsupported action type: %s", action.Type) + } +} + +// UpdateAction is the resolver for the updateAction field. +func (r *mutationResolver) UpdateAction(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + switch action.Type { + case actionservices.ActionTypeAddClusterInfo: + return actionservices.UpdateAddClusterInfo(ctx, id, action) + case actionservices.ActionTypeDeleteAttribute: + return actionservices.UpdateDeleteAttribute(ctx, id, action) + case actionservices.ActionTypePiiMasking: + return actionservices.UpdatePiiMasking(ctx, id, action) + case actionservices.ActionTypeErrorSampler: + return actionservices.UpdateErrorSampler(ctx, id, action) + case actionservices.ActionTypeLatencySampler: + return actionservices.UpdateLatencySampler(ctx, id, action) + case actionservices.ActionTypeProbabilisticSampler: + return actionservices.UpdateProbabilisticSampler(ctx, id, action) + case actionservices.ActionTypeRenameAttribute: + return actionservices.UpdateRenameAttribute(ctx, id, action) + default: + return nil, fmt.Errorf("unsupported action type: %s", action.Type) + } +} + +// DeleteAction is the resolver for the deleteAction field. +func (r *mutationResolver) DeleteAction(ctx context.Context, id string, actionType string) (bool, error) { + switch actionType { + case actionservices.ActionTypeAddClusterInfo: + err := actionservices.DeleteAddClusterInfo(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete AddClusterInfo: %v", err) + } + + case actionservices.ActionTypeDeleteAttribute: + err := actionservices.DeleteDeleteAttribute(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete DeleteAttribute: %v", err) + } + case actionservices.ActionTypePiiMasking: + err := actionservices.DeletePiiMasking(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete PiiMasking: %v", err) + } + case actionservices.ActionTypeErrorSampler: + err := actionservices.DeleteErrorSampler(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete ErrorSampler: %v", err) + } + case actionservices.ActionTypeLatencySampler: + err := actionservices.DeleteLatencySampler(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete LatencySampler: %v", err) + } + case actionservices.ActionTypeProbabilisticSampler: + err := actionservices.DeleteProbabilisticSampler(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete ProbabilisticSampler: %v", err) + } + case actionservices.ActionTypeRenameAttribute: + err := actionservices.DeleteRenameAttribute(ctx, id) + if err != nil { + return false, fmt.Errorf("failed to delete RenameAttribute: %v", err) + } + default: + return false, fmt.Errorf("unsupported action type: %s", actionType) + } + + // Return true if the deletion was successful + return true, nil +} + +// CreateInstrumentationRule is the resolver for the createInstrumentationRule field. +func (r *mutationResolver) CreateInstrumentationRule(ctx context.Context, instrumentationRule model.InstrumentationRuleInput) (*model.InstrumentationRule, error) { + return services.CreateInstrumentationRule(ctx, instrumentationRule) +} + +// UpdateInstrumentationRule is the resolver for the updateInstrumentationRule field. +func (r *mutationResolver) UpdateInstrumentationRule(ctx context.Context, ruleID string, instrumentationRule model.InstrumentationRuleInput) (*model.InstrumentationRule, error) { + return services.UpdateInstrumentationRule(ctx, ruleID, instrumentationRule) +} + +// DeleteInstrumentationRule is the resolver for the deleteInstrumentationRule field. +func (r *mutationResolver) DeleteInstrumentationRule(ctx context.Context, ruleID string) (bool, error) { + _, err := services.DeleteInstrumentationRule(ctx, ruleID) + if err != nil { + return false, err + } + + return true, nil +} + +// ComputePlatform is the resolver for the computePlatform field. +func (r *queryResolver) ComputePlatform(ctx context.Context) (*model.ComputePlatform, error) { + return &model.ComputePlatform{ + ComputePlatformType: model.ComputePlatformTypeK8s, + }, nil +} + +// Config is the resolver for the config field. +func (r *queryResolver) Config(ctx context.Context) (*model.GetConfigResponse, error) { + response := services.GetConfig(ctx) + + gqlResponse := &model.GetConfigResponse{ + Installation: model.InstallationStatus(response.Installation), + } + + return gqlResponse, nil +} + +// DestinationTypes is the resolver for the destinationTypes field. +func (r *queryResolver) DestinationTypes(ctx context.Context) (*model.GetDestinationTypesResponse, error) { + destTypes := services.GetDestinationTypes() + + return &destTypes, nil +} + +// DestinationTypeDetails is the resolver for the destinationTypeDetails field. +func (r *queryResolver) DestinationTypeDetails(ctx context.Context, typeArg string) (*model.GetDestinationDetailsResponse, error) { + destType := common.DestinationType(typeArg) + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found", destType) + } + + var resp model.GetDestinationDetailsResponse + for _, field := range destTypeConfig.Spec.Fields { + componentPropsJSON, err := json.Marshal(field.ComponentProps) + if err != nil { + return nil, fmt.Errorf("error marshalling component properties: %v", err) + } + + resp.Fields = append(resp.Fields, &model.Field{ + Name: field.Name, + DisplayName: field.DisplayName, + ComponentType: field.ComponentType, + ComponentProperties: string(componentPropsJSON), + InitialValue: &field.InitialValue, + }) + + } + + return &resp, nil +} + +// PotentialDestinations is the resolver for the potentialDestinations field. +func (r *queryResolver) PotentialDestinations(ctx context.Context) ([]*model.DestinationDetails, error) { + potentialDestinations := services.PotentialDestinations(ctx) + if potentialDestinations == nil { + return nil, fmt.Errorf("failed to fetch potential destinations") + } + + // Convert []destination_recognition.DestinationDetails to []*DestinationDetails + var result []*model.DestinationDetails + for _, dest := range potentialDestinations { + + fieldsString, err := json.Marshal(dest.Fields) + if err != nil { + return nil, fmt.Errorf("error marshalling fields: %v", err) + } + + result = append(result, &model.DestinationDetails{ + Type: string(dest.Type), + Fields: string(fieldsString), + }) + } + + return result, nil +} + +// GetOverviewMetrics is the resolver for the getOverviewMetrics field. +func (r *queryResolver) GetOverviewMetrics(ctx context.Context) (*model.OverviewMetricsResponse, error) { + if r.MetricsConsumer == nil { + return nil, fmt.Errorf("metrics consumer not initialized") + } + + sourcesMetrics := r.MetricsConsumer.GetSourcesMetrics() + destinationsMetrics := r.MetricsConsumer.GetDestinationsMetrics() + + var sourcesResp []*model.SingleSourceMetricsResponse + for sID, metric := range sourcesMetrics { + sourcesResp = append(sourcesResp, &model.SingleSourceMetricsResponse{ + Namespace: sID.Namespace, + Kind: string(sID.Kind), + Name: sID.Name, + TotalDataSent: int(metric.TotalDataSent()), + Throughput: int(metric.TotalThroughput()), + }) + } + + var destinationsResp []*model.SingleDestinationMetricsResponse + for destId, metric := range destinationsMetrics { + destinationsResp = append(destinationsResp, &model.SingleDestinationMetricsResponse{ + ID: destId, + TotalDataSent: int(metric.TotalDataSent()), + Throughput: int(metric.TotalThroughput()), + }) + } + + return &model.OverviewMetricsResponse{ + Sources: sourcesResp, + Destinations: destinationsResp, + }, nil +} + +// ComputePlatform returns ComputePlatformResolver implementation. +func (r *Resolver) ComputePlatform() ComputePlatformResolver { return &computePlatformResolver{r} } + +// Destination returns DestinationResolver implementation. +func (r *Resolver) Destination() DestinationResolver { return &destinationResolver{r} } + +// K8sActualNamespace returns K8sActualNamespaceResolver implementation. +func (r *Resolver) K8sActualNamespace() K8sActualNamespaceResolver { + return &k8sActualNamespaceResolver{r} +} + +// Mutation returns MutationResolver implementation. +func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } + +// Query returns QueryResolver implementation. +func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } + +type computePlatformResolver struct{ *Resolver } +type destinationResolver struct{ *Resolver } +type k8sActualNamespaceResolver struct{ *Resolver } +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/frontend/main.go b/frontend/main.go index 64777fa68..0fb09570e 100644 --- a/frontend/main.go +++ b/frontend/main.go @@ -34,16 +34,22 @@ import ( "github.com/odigos-io/odigos/frontend/endpoints" _ "net/http/pprof" + + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/playground" + "github.com/odigos-io/odigos/frontend/graph" ) const ( defaultPort = 3000 + betaPort = 3001 ) type Flags struct { Version bool Address string Port int + BetaPort int Debug bool KubeConfig string Namespace string @@ -52,6 +58,9 @@ type Flags struct { //go:embed all:webapp/out/* var uiFS embed.FS +//go:embed all:webapp/dep-out/* +var depUIFS embed.FS + func parseFlags() Flags { defaultKubeConfig := env.GetDefaultKubeConfigPath() @@ -59,6 +68,7 @@ func parseFlags() Flags { flag.BoolVar(&flags.Version, "version", false, "Print Odigos UI version.") flag.StringVar(&flags.Address, "address", "localhost", "Address to listen on") flag.IntVar(&flags.Port, "port", defaultPort, "Port to listen on") + flag.IntVar(&flags.BetaPort, "beta-port", betaPort, "Port to listen on for beta UI") flag.BoolVar(&flags.Debug, "debug", false, "Enable debug mode") flag.StringVar(&flags.KubeConfig, "kubeconfig", defaultKubeConfig, "Path to kubeconfig file") flag.StringVar(&flags.Namespace, "namespace", consts.DefaultOdigosNamespace, "Kubernetes namespace where Odigos is installed") @@ -98,6 +108,56 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics // Serve React app if page not found serve index.html r.NoRoute(gin.WrapH(httpFileServerWith404(http.FS(dist)))) + // GraphQL handlers + gqlHandler := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{ + Resolvers: &graph.Resolver{ + MetricsConsumer: odigosMetrics, + }, + })) + + r.POST("/graphql", func(c *gin.Context) { + gqlHandler.ServeHTTP(c.Writer, c.Request) + }) + r.GET("/playground", gin.WrapH(playground.Handler("GraphQL Playground", "/graphql"))) + + return r, nil +} + +func httpFileServerWith404(fs http.FileSystem) http.Handler { + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := fs.Open(r.URL.Path) + if err != nil { + // Serve index.html + r.URL.Path = "/" + } + http.FileServer(fs).ServeHTTP(w, r) + }) +} + +// dep server +func startHTTPDepServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetricsConsumer) (*gin.Engine, error) { + var r *gin.Engine + if flags.Debug { + r = gin.Default() + } else { + gin.SetMode(gin.ReleaseMode) + r = gin.New() + r.Use(gin.Recovery()) + } + + // Enable CORS + r.Use(cors.Default()) + + // Serve React app + dist, err := fs.Sub(depUIFS, "webapp/dep-out") + if err != nil { + return nil, fmt.Errorf("error reading webapp/def-out directory: %s", err) + } + + // Serve React app if page not found serve index.html + r.NoRoute(gin.WrapH(httpFileServerWith404(http.FS(dist)))) + // Serve API apis := r.Group("/api") { @@ -110,7 +170,6 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics apis.PATCH("/sources/namespace/:namespace/kind/:kind/name/:name", endpoints.PatchSource) apis.GET("/applications/:namespace", endpoints.GetApplicationsInNamespace) - apis.GET("/config", endpoints.GetConfig) apis.GET("/destination-types", endpoints.GetDestinationTypes) apis.GET("/destination-types/:type", endpoints.GetDestinationTypeDetails) apis.GET("/destinations", func(c *gin.Context) { endpoints.GetDestinations(c, flags.Namespace) }) @@ -186,18 +245,19 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics apis.DELETE("/actions/types/PiiMasking/:id", func(c *gin.Context) { actions.DeletePiiMasking(c, flags.Namespace, c.Param("id")) }) } - return r, nil -} + // GraphQL handlers + gqlHandler := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{ + Resolvers: &graph.Resolver{ + MetricsConsumer: odigosMetrics, + }, + })) -func httpFileServerWith404(fs http.FileSystem) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, err := fs.Open(r.URL.Path) - if err != nil { - // Serve index.html - r.URL.Path = "/" - } - http.FileServer(fs).ServeHTTP(w, r) + r.POST("/graphql", func(c *gin.Context) { + gqlHandler.ServeHTTP(c.Writer, c.Request) }) + r.GET("/playground", gin.WrapH(playground.Handler("GraphQL Playground", "/graphql"))) + + return r, nil } func main() { @@ -245,6 +305,11 @@ func main() { log.Fatalf("Error starting server: %s", err) } + d, err := startHTTPDepServer(&flags, odigosMetrics) + if err != nil { + log.Fatalf("Error starting server: %s", err) + } + // Start watchers err = watchers.StartInstrumentedApplicationWatcher(ctx, "") if err != nil { @@ -262,12 +327,22 @@ func main() { } r.GET("/api/events", sse.HandleSSEConnections) + d.GET("/api/events", sse.HandleSSEConnections) log.Println("Starting Odigos UI...") - log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.Port) + log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.BetaPort) + + go func() { + err = r.Run(fmt.Sprintf("%s:%d", flags.Address, flags.BetaPort)) + if err != nil { + log.Fatalf("Error starting server: %s", err) + } + }() go func() { - err = r.Run(fmt.Sprintf("%s:%d", flags.Address, flags.Port)) + log.Println("Starting Odigos Dep UI...") + log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.Port) + err = d.Run(fmt.Sprintf("%s:%d", flags.Address, flags.Port)) if err != nil { log.Fatalf("Error starting server: %s", err) } diff --git a/frontend/services/actions/addclusterinfo.go b/frontend/services/actions/addclusterinfo.go new file mode 100644 index 000000000..57f324883 --- /dev/null +++ b/frontend/services/actions/addclusterinfo.go @@ -0,0 +1,162 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type AddClusterInfoDetails struct { + ClusterAttributes []model.ClusterInfo `json:"clusterAttributes"` +} + +func CreateAddClusterInfo(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details AddClusterInfoDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for AddClusterInfo: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + clusterAttributes := make([]v1alpha1.OtelAttributeWithValue, len(details.ClusterAttributes)) + for i, attr := range details.ClusterAttributes { + clusterAttributes[i] = v1alpha1.OtelAttributeWithValue{ + AttributeName: attr.AttributeName, + AttributeStringValue: attr.AttributeStringValue, + } + } + + addClusterInfoAction := &v1alpha1.AddClusterInfo{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "aci-", + }, + Spec: v1alpha1.AddClusterInfoSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + ClusterAttributes: clusterAttributes, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).Create(ctx, addClusterInfoAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create AddClusterInfo: %v", err) + } + + resDetails := make([]*model.ClusterInfo, len(details.ClusterAttributes)) + for i, attr := range details.ClusterAttributes { + resDetails[i] = &model.ClusterInfo{ + AttributeName: attr.AttributeName, + AttributeStringValue: attr.AttributeStringValue, + } + } + + response := &model.AddClusterInfoAction{ + ID: generatedAction.Name, + Type: ActionTypeAddClusterInfo, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: resDetails, + } + + return response, nil +} + +func UpdateAddClusterInfo(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + // Fetch the existing action + existingAction, err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch AddClusterInfo: %v", err) + } + + // Parse the details from action.Details + var details AddClusterInfoDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for AddClusterInfo: %v", err) + } + + // Convert signals from action input + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + // Convert ClusterAttributes from model to v1alpha1 + clusterAttributes := make([]v1alpha1.OtelAttributeWithValue, len(details.ClusterAttributes)) + for i, attr := range details.ClusterAttributes { + clusterAttributes[i] = v1alpha1.OtelAttributeWithValue{ + AttributeName: attr.AttributeName, + AttributeStringValue: attr.AttributeStringValue, + } + } + + // Update the existing action with new values + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.ClusterAttributes = clusterAttributes + + // Update the action in Kubernetes + updatedAction, err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update AddClusterInfo: %v", err) + } + + // Prepare the response model + resDetails := make([]*model.ClusterInfo, len(details.ClusterAttributes)) + for i, attr := range details.ClusterAttributes { + resDetails[i] = &model.ClusterInfo{ + AttributeName: attr.AttributeName, + AttributeStringValue: attr.AttributeStringValue, + } + } + + // Return the updated model as the response + response := &model.AddClusterInfoAction{ + ID: updatedAction.Name, + Type: ActionTypeAddClusterInfo, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: resDetails, + } + + return response, nil +} + +func DeleteAddClusterInfo(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + // Delete the action by its ID from Kubernetes + err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("AddClusterInfo action with ID %s not found", id) + } + return fmt.Errorf("failed to delete AddClusterInfo action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/constants.go b/frontend/services/actions/constants.go new file mode 100644 index 000000000..aed6dc0fa --- /dev/null +++ b/frontend/services/actions/constants.go @@ -0,0 +1,11 @@ +package services + +const ( + ActionTypeAddClusterInfo = "AddClusterInfo" + ActionTypeDeleteAttribute = "DeleteAttribute" + ActionTypeRenameAttribute = "RenameAttribute" + ActionTypePiiMasking = "PiiMasking" + ActionTypeErrorSampler = "ErrorSampler" + ActionTypeLatencySampler = "LatencySampler" + ActionTypeProbabilisticSampler = "ProbabilisticSampler" +) diff --git a/frontend/services/actions/deleteattribute.go b/frontend/services/actions/deleteattribute.go new file mode 100644 index 000000000..ae5e84ba0 --- /dev/null +++ b/frontend/services/actions/deleteattribute.go @@ -0,0 +1,124 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type DeleteAttributeDetails struct { + AttributeNamesToDelete []string `json:"attributeNamesToDelete"` +} + +// CreateDeleteAttribute creates a new DeleteAttribute action in Kubernetes +func CreateDeleteAttribute(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details DeleteAttributeDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for DeleteAttribute: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + deleteAttributeAction := &v1alpha1.DeleteAttribute{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "da-", + }, + Spec: v1alpha1.DeleteAttributeSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + AttributeNamesToDelete: details.AttributeNamesToDelete, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).Create(ctx, deleteAttributeAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create DeleteAttribute: %v", err) + } + + response := &model.DeleteAttributeAction{ + ID: generatedAction.Name, + Type: ActionTypeDeleteAttribute, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: details.AttributeNamesToDelete, + } + + return response, nil +} + +// UpdateDeleteAttribute updates an existing DeleteAttribute action in Kubernetes +func UpdateDeleteAttribute(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch DeleteAttribute: %v", err) + } + + var details DeleteAttributeDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for DeleteAttribute: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.AttributeNamesToDelete = details.AttributeNamesToDelete + + updatedAction, err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update DeleteAttribute: %v", err) + } + + response := &model.DeleteAttributeAction{ + ID: updatedAction.Name, + Type: ActionTypeDeleteAttribute, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: details.AttributeNamesToDelete, + } + + return response, nil +} + +// DeleteDeleteAttribute deletes an existing DeleteAttribute action from Kubernetes +func DeleteDeleteAttribute(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("DeleteAttribute action with ID %s not found", id) + } + return fmt.Errorf("failed to delete DeleteAttribute action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/errorsampler.go b/frontend/services/actions/errorsampler.go new file mode 100644 index 000000000..1d97db211 --- /dev/null +++ b/frontend/services/actions/errorsampler.go @@ -0,0 +1,125 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + "strconv" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type ErrorSamplerDetails struct { + FallbackSamplingRatio float64 `json:"fallback_sampling_ratio"` +} + +// CreateErrorSampler creates a new ErrorSampler action in Kubernetes +func CreateErrorSampler(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details ErrorSamplerDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for ErrorSampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + errorSamplerAction := &v1alpha1.ErrorSampler{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "es-", + }, + Spec: v1alpha1.ErrorSamplerSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + FallbackSamplingRatio: details.FallbackSamplingRatio, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).Create(ctx, errorSamplerAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create ErrorSampler: %v", err) + } + detailsString := strconv.FormatFloat(details.FallbackSamplingRatio, 'f', -1, 64) + response := &model.ErrorSamplerAction{ + ID: generatedAction.Name, + Type: ActionTypeErrorSampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: detailsString, + } + + return response, nil +} + +// UpdateErrorSampler updates an existing ErrorSampler action in Kubernetes +func UpdateErrorSampler(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch ErrorSampler: %v", err) + } + + var details ErrorSamplerDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for ErrorSampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.FallbackSamplingRatio = details.FallbackSamplingRatio + + updatedAction, err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update ErrorSampler: %v", err) + } + detailsString := strconv.FormatFloat(details.FallbackSamplingRatio, 'f', -1, 64) + response := &model.ErrorSamplerAction{ + ID: updatedAction.Name, + Type: ActionTypeErrorSampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: detailsString, + } + + return response, nil +} + +// DeleteErrorSampler deletes an existing ErrorSampler action from Kubernetes +func DeleteErrorSampler(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("ErrorSampler action with ID %s not found", id) + } + return fmt.Errorf("failed to delete ErrorSampler action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/latencysampler.go b/frontend/services/actions/latencysampler.go new file mode 100644 index 000000000..32be71ddc --- /dev/null +++ b/frontend/services/actions/latencysampler.go @@ -0,0 +1,139 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type LatencySamplerDetails struct { + EndpointsFilters []v1alpha1.HttpRouteFilter `json:"endpoints_filters"` +} + +// CreateLatencySampler creates a new LatencySampler action in Kubernetes +func CreateLatencySampler(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details LatencySamplerDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for LatencySampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + latencySamplerAction := &v1alpha1.LatencySampler{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "ls-", + }, + Spec: v1alpha1.LatencySamplerSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + EndpointsFilters: details.EndpointsFilters, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).Create(ctx, latencySamplerAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create LatencySampler: %v", err) + } + + // Convert Endpoint Filters to JSON string for response details + detailsJSON, err := json.Marshal(details.EndpointsFilters) + if err != nil { + return nil, fmt.Errorf("failed to marshal endpoint filters: %v", err) + } + responseDetails := []*string{services.StringPtr(string(detailsJSON))} + + response := &model.LatencySamplerAction{ + ID: generatedAction.Name, + Type: ActionTypeLatencySampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +// UpdateLatencySampler updates an existing LatencySampler action in Kubernetes +func UpdateLatencySampler(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch LatencySampler: %v", err) + } + + var details LatencySamplerDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for LatencySampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + // Update the existing action with new values + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.EndpointsFilters = details.EndpointsFilters + + updatedAction, err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update LatencySampler: %v", err) + } + + // Convert Endpoint Filters to JSON string for response details + detailsJSON, err := json.Marshal(details.EndpointsFilters) + if err != nil { + return nil, fmt.Errorf("failed to marshal endpoint filters: %v", err) + } + responseDetails := []*string{services.StringPtr(string(detailsJSON))} + + response := &model.LatencySamplerAction{ + ID: updatedAction.Name, + Type: ActionTypeLatencySampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +// DeleteLatencySampler deletes an existing LatencySampler action from Kubernetes +func DeleteLatencySampler(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("LatencySampler action with ID %s not found", id) + } + return fmt.Errorf("failed to delete LatencySampler action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/piimasking.go b/frontend/services/actions/piimasking.go new file mode 100644 index 000000000..6056100ae --- /dev/null +++ b/frontend/services/actions/piimasking.go @@ -0,0 +1,134 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type PiiMaskingDetails struct { + PiiCategories []v1alpha1.PiiCategory `json:"piiCategories"` +} + +// CreatePiiMasking creates a new PiiMasking action in Kubernetes +func CreatePiiMasking(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details PiiMaskingDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for PiiMasking: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + piiMaskingAction := &v1alpha1.PiiMasking{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "pi-", + }, + Spec: v1alpha1.PiiMaskingSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + PiiCategories: details.PiiCategories, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).Create(ctx, piiMaskingAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create PiiMasking: %v", err) + } + + piiCategories := make([]string, len(details.PiiCategories)) + for i, category := range details.PiiCategories { + piiCategories[i] = string(category) + } + + response := &model.PiiMaskingAction{ + ID: generatedAction.Name, + Type: ActionTypePiiMasking, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: piiCategories, + } + + return response, nil +} + +// UpdatePiiMasking updates an existing PiiMasking action in Kubernetes +func UpdatePiiMasking(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch PiiMasking: %v", err) + } + + var details PiiMaskingDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for PiiMasking: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.PiiCategories = details.PiiCategories + + updatedAction, err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update PiiMasking: %v", err) + } + + piiCategories := make([]string, len(details.PiiCategories)) + for i, category := range details.PiiCategories { + piiCategories[i] = string(category) + } + + response := &model.PiiMaskingAction{ + ID: updatedAction.Name, + Type: ActionTypePiiMasking, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: piiCategories, + } + + return response, nil +} + +// DeletePiiMasking deletes an existing PiiMasking action from Kubernetes +func DeletePiiMasking(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("PiiMasking action with ID %s not found", id) + } + return fmt.Errorf("failed to delete PiiMasking action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/probabilisticsampler.go b/frontend/services/actions/probabilisticsampler.go new file mode 100644 index 000000000..f00c13506 --- /dev/null +++ b/frontend/services/actions/probabilisticsampler.go @@ -0,0 +1,139 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type ProbabilisticSamplerDetails struct { + SamplingPercentage string `json:"sampling_percentage"` +} + +// CreateProbabilisticSampler creates a new ProbabilisticSampler action in Kubernetes +func CreateProbabilisticSampler(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details ProbabilisticSamplerDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for ProbabilisticSampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + probabilisticSamplerAction := &v1alpha1.ProbabilisticSampler{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "ps-", + }, + Spec: v1alpha1.ProbabilisticSamplerSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + SamplingPercentage: details.SamplingPercentage, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).Create(ctx, probabilisticSamplerAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create ProbabilisticSampler: %v", err) + } + + // Convert SamplingPercentage to JSON string and assign it as the first element of []*string + detailsJSON, err := json.Marshal(details.SamplingPercentage) + if err != nil { + return nil, fmt.Errorf("failed to marshal sampling percentage: %v", err) + } + responseDetails := string(detailsJSON) + + response := &model.ProbabilisticSamplerAction{ + ID: generatedAction.Name, + Type: ActionTypeProbabilisticSampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +// UpdateProbabilisticSampler updates an existing ProbabilisticSampler action in Kubernetes +func UpdateProbabilisticSampler(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch ProbabilisticSampler: %v", err) + } + + var details ProbabilisticSamplerDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for ProbabilisticSampler: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + // Update the existing action with new values + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.SamplingPercentage = details.SamplingPercentage + + updatedAction, err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update ProbabilisticSampler: %v", err) + } + + // Convert SamplingPercentage to JSON string and assign it as the first element of []*string + detailsJSON, err := json.Marshal(details.SamplingPercentage) + if err != nil { + return nil, fmt.Errorf("failed to marshal sampling percentage: %v", err) + } + responseDetails := string(detailsJSON) + + response := &model.ProbabilisticSamplerAction{ + ID: updatedAction.Name, + Type: ActionTypeProbabilisticSampler, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +// DeleteProbabilisticSampler deletes an existing ProbabilisticSampler action from Kubernetes +func DeleteProbabilisticSampler(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("ProbabilisticSampler action with ID %s not found", id) + } + return fmt.Errorf("failed to delete ProbabilisticSampler action: %v", err) + } + + return nil +} diff --git a/frontend/services/actions/renameattribute.go b/frontend/services/actions/renameattribute.go new file mode 100644 index 000000000..61a3740ab --- /dev/null +++ b/frontend/services/actions/renameattribute.go @@ -0,0 +1,138 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/actions/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type RenameAttributeDetails struct { + Renames map[string]string `json:"renames"` +} + +// CreateRenameAttribute creates a new RenameAttribute action in Kubernetes +func CreateRenameAttribute(ctx context.Context, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + var details RenameAttributeDetails + err := json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for RenameAttribute: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + renameAttributeAction := &v1alpha1.RenameAttribute{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "ra-", + }, + Spec: v1alpha1.RenameAttributeSpec{ + ActionName: services.DerefString(action.Name), + Notes: services.DerefString(action.Notes), + Disabled: action.Disable, + Signals: signals, + Renames: details.Renames, + }, + } + + generatedAction, err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).Create(ctx, renameAttributeAction, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to create RenameAttribute: %v", err) + } + + // Convert Renames to JSON string for response details + detailsJSON, err := json.Marshal(details.Renames) + if err != nil { + return nil, fmt.Errorf("failed to marshal renames: %v", err) + } + responseDetails := string(detailsJSON) + + response := &model.RenameAttributeAction{ + ID: generatedAction.Name, + Type: ActionTypeRenameAttribute, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +// UpdateRenameAttribute updates an existing RenameAttribute action in Kubernetes +func UpdateRenameAttribute(ctx context.Context, id string, action model.ActionInput) (model.Action, error) { + odigosns := consts.DefaultOdigosNamespace + + existingAction, err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to fetch RenameAttribute: %v", err) + } + + var details RenameAttributeDetails + err = json.Unmarshal([]byte(action.Details), &details) + if err != nil { + return nil, fmt.Errorf("invalid details for RenameAttribute: %v", err) + } + + signals, err := services.ConvertSignals(action.Signals) + if err != nil { + return nil, fmt.Errorf("failed to convert signals: %v", err) + } + + // Update the existing action with new values + existingAction.Spec.ActionName = services.DerefString(action.Name) + existingAction.Spec.Notes = services.DerefString(action.Notes) + existingAction.Spec.Disabled = action.Disable + existingAction.Spec.Signals = signals + existingAction.Spec.Renames = details.Renames + + updatedAction, err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).Update(ctx, existingAction, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update RenameAttribute: %v", err) + } + + // Convert Renames to JSON string for response details + detailsJSON, err := json.Marshal(details.Renames) + if err != nil { + return nil, fmt.Errorf("failed to marshal renames: %v", err) + } + responseDetails := string(detailsJSON) + + response := &model.RenameAttributeAction{ + ID: updatedAction.Name, + Type: ActionTypeRenameAttribute, + Name: action.Name, + Notes: action.Notes, + Disable: action.Disable, + Signals: action.Signals, + Details: responseDetails, + } + + return response, nil +} + +func DeleteRenameAttribute(ctx context.Context, id string) error { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("RenameAttribute action with ID %s not found", id) + } + return fmt.Errorf("failed to delete RenameAttribute action: %v", err) + } + + return nil +} diff --git a/frontend/services/config.go b/frontend/services/config.go new file mode 100644 index 000000000..4a4bca6b2 --- /dev/null +++ b/frontend/services/config.go @@ -0,0 +1,103 @@ +package services + +import ( + "context" + "fmt" + "log" + + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/kube" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type InstallationStatus string + +const ( + NewInstallation InstallationStatus = "NEW" + AppsSelected InstallationStatus = "APPS_SELECTED" + Finished InstallationStatus = "FINISHED" +) + +type GetConfigResponse struct { + Installation InstallationStatus `json:"installation"` +} + +func GetConfig(c context.Context) GetConfigResponse { + var response GetConfigResponse + if !isSomethingLabeled(c) { + response.Installation = NewInstallation + } else if !isDestinationChosen(c) { + response.Installation = AppsSelected + } else { + response.Installation = Finished + } + return response + +} + +func isDestinationChosen(ctx context.Context) bool { + dests, err := kube.DefaultClient.OdigosClient.Destinations("").List(ctx, metav1.ListOptions{}) + if err != nil { + log.Printf("Error listing destinations: %v\n", err) + return false + } + + return len(dests.Items) > 0 +} + +func isSomethingLabeled(ctx context.Context) bool { + labelSelector := fmt.Sprintf("%s=%s", consts.OdigosInstrumentationLabel, consts.InstrumentationEnabled) + ns, err := kube.DefaultClient.CoreV1().Namespaces().List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + log.Printf("Error listing namespaces: %v\n", err) + return false + } + + if len(ns.Items) > 0 { + return true + } + + deps, err := kube.DefaultClient.AppsV1().Deployments("").List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + log.Printf("Error listing deployments: %v\n", err) + return false + } + + if len(deps.Items) > 0 { + return true + } + + ss, err := kube.DefaultClient.AppsV1().StatefulSets("").List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + log.Printf("Error listing statefulsets: %v\n", err) + return false + } + + if len(ss.Items) > 0 { + return true + } + + ds, err := kube.DefaultClient.AppsV1().DaemonSets("").List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + log.Printf("Error listing daemonsets: %v\n", err) + return false + } + + if len(ds.Items) > 0 { + return true + } + + return false +} diff --git a/frontend/services/destination_recognition/destination_finder.go b/frontend/services/destination_recognition/destination_finder.go new file mode 100644 index 000000000..20258eff7 --- /dev/null +++ b/frontend/services/destination_recognition/destination_finder.go @@ -0,0 +1,79 @@ +package destination_recognition + +import ( + "context" + + odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/k8sutils/pkg/client" + k8s "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var SupportedDestinationType = []common.DestinationType{common.JaegerDestinationType, common.ElasticsearchDestinationType} + +type DestinationDetails struct { + Type common.DestinationType `json:"type"` + Fields map[string]string `json:"fields"` +} + +type IDestinationFinder interface { + isPotentialService(k8s.Service) bool + fetchDestinationDetails(k8s.Service) DestinationDetails + getServiceURL() string +} + +func GetAllPotentialDestinationDetails(ctx context.Context, namespaces []k8s.Namespace, dests *odigosv1.DestinationList) ([]DestinationDetails, error) { + var destinationFinder IDestinationFinder + var destinationDetails []DestinationDetails + var err error + + for _, ns := range namespaces { + err = client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.CoreV1().Services(ns.Name).List, + ctx, metav1.ListOptions{}, func(services *k8s.ServiceList) error { + for _, service := range services.Items { + for _, destinationType := range SupportedDestinationType { + destinationFinder = getDestinationFinder(destinationType) + + if destinationFinder.isPotentialService(service) { + potentialDestination := destinationFinder.fetchDestinationDetails(service) + + if !destinationExist(dests, potentialDestination, destinationFinder) { + destinationDetails = append(destinationDetails, potentialDestination) + } + break + } + } + } + return nil + }) + } + + if err != nil { + return nil, err + } + + return destinationDetails, nil +} + +func getDestinationFinder(destinationType common.DestinationType) IDestinationFinder { + switch destinationType { + case common.JaegerDestinationType: + return &JaegerDestinationFinder{} + case common.ElasticsearchDestinationType: + return &ElasticSearchDestinationFinder{} + } + + return nil +} + +func destinationExist(dests *odigosv1.DestinationList, potentialDestination DestinationDetails, destinationFinder IDestinationFinder) bool { + for _, dest := range dests.Items { + if dest.Spec.Type == potentialDestination.Type && dest.GetConfig()[destinationFinder.getServiceURL()] == potentialDestination.Fields[destinationFinder.getServiceURL()] { + return true + } + } + + return false +} diff --git a/frontend/services/destination_recognition/elasticsearch.go b/frontend/services/destination_recognition/elasticsearch.go new file mode 100644 index 000000000..38c3e7093 --- /dev/null +++ b/frontend/services/destination_recognition/elasticsearch.go @@ -0,0 +1,45 @@ +package destination_recognition + +import ( + "fmt" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + k8s "k8s.io/api/core/v1" +) + +type ElasticSearchDestinationFinder struct{} + +const ElasticSearchHttpPort int32 = 9200 +const ElasticSearchHttpUrlFormat = "https://%s.%s:%d" + +func (j *ElasticSearchDestinationFinder) isPotentialService(service k8s.Service) bool { + for _, port := range service.Spec.Ports { + if isElasticSearchService(port.Port, service.Name) { + return true + } + } + + return false +} + +func isElasticSearchService(portNumber int32, name string) bool { + return portNumber == ElasticSearchHttpPort && strings.Contains(name, string(common.ElasticsearchDestinationType)) +} + +func (j *ElasticSearchDestinationFinder) fetchDestinationDetails(service k8s.Service) DestinationDetails { + urlString := fmt.Sprintf(ElasticSearchHttpUrlFormat, service.Name, service.Namespace, ElasticSearchHttpPort) + elasticServiceURL := j.getServiceURL() + fields := make(map[string]string) + fields[elasticServiceURL] = urlString + + return DestinationDetails{ + Type: common.ElasticsearchDestinationType, + Fields: fields, + } +} + +func (j *ElasticSearchDestinationFinder) getServiceURL() string { + return config.ElasticsearchUrlKey +} diff --git a/frontend/services/destination_recognition/jaeger.go b/frontend/services/destination_recognition/jaeger.go new file mode 100644 index 000000000..f66fd9bdd --- /dev/null +++ b/frontend/services/destination_recognition/jaeger.go @@ -0,0 +1,46 @@ +package destination_recognition + +import ( + "fmt" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + k8s "k8s.io/api/core/v1" +) + +type JaegerDestinationFinder struct{} + +const JaegerGrpcOtlpPort int32 = 4317 +const JaegerGrpcUrlFormat = "%s.%s:%d" + +func (j *JaegerDestinationFinder) isPotentialService(service k8s.Service) bool { + for _, port := range service.Spec.Ports { + if isJaegerService(port.Port, service.Name) { + return true + } + } + + return false +} + +func isJaegerService(portNumber int32, name string) bool { + return portNumber == JaegerGrpcOtlpPort && strings.Contains(name, string(common.JaegerDestinationType)) +} + +func (j *JaegerDestinationFinder) fetchDestinationDetails(service k8s.Service) DestinationDetails { + urlString := fmt.Sprintf(JaegerGrpcUrlFormat, service.Name, service.Namespace, JaegerGrpcOtlpPort) + + jaegerServiceURL := j.getServiceURL() + fields := make(map[string]string) + fields[jaegerServiceURL] = urlString + + return DestinationDetails{ + Type: common.JaegerDestinationType, + Fields: fields, + } +} + +func (j *JaegerDestinationFinder) getServiceURL() string { + return config.JaegerUrlKey +} diff --git a/frontend/services/destinations.go b/frontend/services/destinations.go new file mode 100644 index 000000000..79147d89b --- /dev/null +++ b/frontend/services/destinations.go @@ -0,0 +1,300 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/destinations" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services/destination_recognition" + "github.com/odigos-io/odigos/k8sutils/pkg/env" + k8s "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +func GetDestinationTypes() model.GetDestinationTypesResponse { + var resp model.GetDestinationTypesResponse + itemsByCategory := make(map[string][]model.DestinationTypesCategoryItem) + for _, destConfig := range destinations.Get() { + item := DestinationTypeConfigToCategoryItem(destConfig) + itemsByCategory[destConfig.Metadata.Category] = append(itemsByCategory[destConfig.Metadata.Category], item) + } + + for category, items := range itemsByCategory { + resp.Categories = append(resp.Categories, model.DestinationsCategory{ + Name: category, + Items: items, + }) + + } + + return resp + +} + +func DestinationTypeConfigToCategoryItem(destConfig destinations.Destination) model.DestinationTypesCategoryItem { + + return model.DestinationTypesCategoryItem{ + Type: string(destConfig.Metadata.Type), + DisplayName: destConfig.Metadata.DisplayName, + ImageUrl: GetImageURL(destConfig.Spec.Image), + TestConnectionSupported: destConfig.Spec.TestConnectionSupported, + SupportedSignals: model.SupportedSignals{ + Traces: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Traces.Supported, + }, + Metrics: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Metrics.Supported, + }, + Logs: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Logs.Supported, + }, + }, + } + +} + +func GetDestinationTypeConfig(destType common.DestinationType) (*destinations.Destination, error) { + for _, dest := range destinations.Get() { + if dest.Metadata.Type == destType { + return &dest, nil + } + } + + return nil, fmt.Errorf("destination type %s not found", destType) +} + +func VerifyDestinationDataScheme(destType common.DestinationType, destTypeConfig *destinations.Destination, data map[string]string) []error { + + errors := []error{} + + // verify all fields in config are present in data (assuming here all fields are required) + for _, field := range destTypeConfig.Spec.Fields { + required, ok := field.ComponentProps["required"].(bool) + if !ok || !required { + continue + } + fieldValue, found := data[field.Name] + if !found || fieldValue == "" { + errors = append(errors, fmt.Errorf("field %s is required", field.Name)) + } + } + + // verify data fields are found in config + for dataField := range data { + found := false + // iterating all fields in config every time, assuming it's a small list + for _, field := range destTypeConfig.Spec.Fields { + if dataField == field.Name { + found = true + break + } + } + if !found { + errors = append(errors, fmt.Errorf("field %s is not found in config for destination type '%s'", dataField, destType)) + } + } + + return errors +} + +func TransformFieldsToDataAndSecrets(destTypeConfig *destinations.Destination, fields map[string]string) (map[string]string, map[string]string) { + + dataFields := map[string]string{} + secretFields := map[string]string{} + + for fieldName, fieldValue := range fields { + + // it is possible that some fields are not required and are empty. + // we should treat them as empty + if fieldValue == "" { + continue + } + + // for each field in the data, find it's config + // assuming the list is small so it's ok to iterate it + for _, fieldConfig := range destTypeConfig.Spec.Fields { + if fieldName == fieldConfig.Name { + if fieldConfig.Secret { + secretFields[fieldName] = fieldValue + } else { + dataFields[fieldName] = fieldValue + } + } + } + } + + return dataFields, secretFields +} + +func GetDestinationSecretFields(c context.Context, odigosns string, dest *v1alpha1.Destination) (map[string]string, error) { + + secretFields := map[string]string{} + secretRef := dest.Spec.SecretRef + + if secretRef == nil { + return secretFields, nil + } + + secret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Get(c, secretRef.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + for k, v := range secret.Data { + secretFields[k] = string(v) + } + + return secretFields, nil +} + +func K8sDestinationToEndpointFormat(k8sDest v1alpha1.Destination, secretFields map[string]string) model.Destination { + destType := k8sDest.Spec.Type + destName := k8sDest.Spec.DestinationName + mergedFields := mergeDataAndSecrets(k8sDest.Spec.Data, secretFields) + destTypeConfig := DestinationTypeConfigToCategoryItem(destinations.GetDestinationByType(string(destType))) + + fieldsJSON, err := json.Marshal(mergedFields) + if err != nil { + // Handle JSON encoding error + fmt.Printf("Error marshaling fields to JSON: %v\n", err) + fieldsJSON = []byte("{}") // Set to an empty JSON object in case of error + } + + var conditions []metav1.Condition + for _, condition := range k8sDest.Status.Conditions { + conditions = append(conditions, metav1.Condition{ + Type: condition.Type, + Status: condition.Status, + Message: condition.Message, + LastTransitionTime: condition.LastTransitionTime, + }) + } + + return model.Destination{ + Id: k8sDest.Name, + Name: destName, + Type: destType, + ExportedSignals: model.ExportedSignals{ + Traces: isSignalExported(k8sDest, common.TracesObservabilitySignal), + Metrics: isSignalExported(k8sDest, common.MetricsObservabilitySignal), + Logs: isSignalExported(k8sDest, common.LogsObservabilitySignal), + }, + Fields: string(fieldsJSON), + DestinationType: destTypeConfig, + Conditions: conditions, + } +} + +func isSignalExported(dest v1alpha1.Destination, signal common.ObservabilitySignal) bool { + for _, s := range dest.Spec.Signals { + if s == signal { + return true + } + } + + return false +} + +func mergeDataAndSecrets(data map[string]string, secrets map[string]string) map[string]string { + merged := map[string]string{} + + for k, v := range data { + merged[k] = v + } + + for k, v := range secrets { + merged[k] = v + } + + return merged +} +func ExportedSignalsObjectToSlice(signals *model.ExportedSignalsInput) []common.ObservabilitySignal { + var resp []common.ObservabilitySignal + if signals.Traces { + resp = append(resp, common.TracesObservabilitySignal) + } + if signals.Metrics { + resp = append(resp, common.MetricsObservabilitySignal) + } + if signals.Logs { + resp = append(resp, common.LogsObservabilitySignal) + } + + return resp +} + +func CreateDestinationSecret(ctx context.Context, destType common.DestinationType, secretFields map[string]string, odigosns string) (*k8s.LocalObjectReference, error) { + generateNamePrefix := "odigos.io.dest." + string(destType) + "-" + secret := k8s.Secret{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: generateNamePrefix, + }, + StringData: secretFields, + } + newSecret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Create(ctx, &secret, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + return &k8s.LocalObjectReference{ + Name: newSecret.Name, + }, nil +} + +func AddDestinationOwnerReferenceToSecret(ctx context.Context, odigosns string, dest *v1alpha1.Destination) error { + destOwnerRef := metav1.OwnerReference{ + APIVersion: "odigos.io/v1alpha1", + Kind: "Destination", + Name: dest.Name, + UID: dest.UID, + } + + secretPatch := []struct { + Op string `json:"op"` + Path string `json:"path"` + Value []metav1.OwnerReference `json:"value"` + }{{ + Op: "add", + Path: "/metadata/ownerReferences", + Value: []metav1.OwnerReference{destOwnerRef}, + }, + } + + secretPatchBytes, err := json.Marshal(secretPatch) + if err != nil { + return err + } + + _, err = kube.DefaultClient.CoreV1().Secrets(odigosns).Patch(ctx, dest.Spec.SecretRef.Name, types.JSONPatchType, secretPatchBytes, metav1.PatchOptions{}) + if err != nil { + return err + } + return nil +} + +func PotentialDestinations(ctx context.Context) []destination_recognition.DestinationDetails { + odigosns := consts.DefaultOdigosNamespace + relevantNamespaces, err := getRelevantNameSpaces(ctx, env.GetCurrentNamespace()) + if err != nil { + return nil + } + + // Existing Destinations + existingDestination, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil + } + + destinationDetails, err := destination_recognition.GetAllPotentialDestinationDetails(ctx, relevantNamespaces, existingDestination) + if err != nil { + return nil + } + + return destinationDetails +} diff --git a/frontend/services/instrumentationrule.go b/frontend/services/instrumentationrule.go new file mode 100644 index 000000000..8f980c834 --- /dev/null +++ b/frontend/services/instrumentationrule.go @@ -0,0 +1,305 @@ +package services + +import ( + "context" + "fmt" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + instrumentationrules "github.com/odigos-io/odigos/api/odigos/v1alpha1/instrumentationrules" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ListInstrumentationRules fetches all instrumentation rules +func ListInstrumentationRules(ctx context.Context) ([]*model.InstrumentationRule, error) { + odigosns := consts.DefaultOdigosNamespace + instrumentationRules, err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, fmt.Errorf("error getting instrumentation rules: %w", err) + } + + var gqlRules []*model.InstrumentationRule + for _, rule := range instrumentationRules.Items { + + gqlRules = append(gqlRules, &model.InstrumentationRule{ + RuleID: rule.Name, + RuleName: &rule.Spec.RuleName, + Notes: &rule.Spec.Notes, + Disabled: &rule.Spec.Disabled, + Workloads: convertWorkloads(rule.Spec.Workloads), + InstrumentationLibraries: convertInstrumentationLibraries(rule.Spec.InstrumentationLibraries), + PayloadCollection: convertPayloadCollection(rule.Spec.PayloadCollection), + }) + } + return gqlRules, nil +} + +func GetInstrumentationRule(ctx context.Context, id string) (*model.InstrumentationRule, error) { + odigosns := consts.DefaultOdigosNamespace + + rule, err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, handleNotFoundError(err, id, "instrumentation rule") + } + + return &model.InstrumentationRule{ + RuleID: rule.Name, + RuleName: &rule.Spec.RuleName, + Notes: &rule.Spec.Notes, + Disabled: &rule.Spec.Disabled, + Workloads: convertWorkloads(rule.Spec.Workloads), + InstrumentationLibraries: convertInstrumentationLibraries(rule.Spec.InstrumentationLibraries), + PayloadCollection: convertPayloadCollection(rule.Spec.PayloadCollection), + }, nil +} + +func UpdateInstrumentationRule(ctx context.Context, id string, input model.InstrumentationRuleInput) (*model.InstrumentationRule, error) { + odigosns := consts.DefaultOdigosNamespace + + // Retrieve existing rule + existingRule, err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, handleNotFoundError(err, id, "instrumentation rule") + } + // Update the existing rule's specification + existingRule.Spec.RuleName = *input.RuleName + existingRule.Spec.Notes = *input.Notes + existingRule.Spec.Disabled = *input.Disabled + if input.Workloads != nil { + convertedWorkloads := make([]workload.PodWorkload, len(input.Workloads)) + for i, w := range input.Workloads { + convertedWorkloads[i] = workload.PodWorkload{ + Name: w.Name, + Namespace: w.Namespace, + Kind: workload.WorkloadKind(w.Kind), + } + } + existingRule.Spec.Workloads = &convertedWorkloads + } else { + existingRule.Spec.Workloads = nil + } + + if input.InstrumentationLibraries != nil { + convertedLibraries := make([]v1alpha1.InstrumentationLibraryGlobalId, len(input.InstrumentationLibraries)) + for i, lib := range input.InstrumentationLibraries { + convertedLibraries[i] = v1alpha1.InstrumentationLibraryGlobalId{ + Name: lib.Name, + SpanKind: common.SpanKind(*lib.SpanKind), + Language: common.ProgrammingLanguage(*lib.Language), + } + } + existingRule.Spec.InstrumentationLibraries = &convertedLibraries + } else { + existingRule.Spec.InstrumentationLibraries = nil + } + + if input.PayloadCollection != nil { + payloadCollection := &instrumentationrules.PayloadCollection{} + + if input.PayloadCollection.HTTPRequest != nil { + payloadCollection.HttpRequest = &instrumentationrules.HttpPayloadCollection{} + } + + if input.PayloadCollection.HTTPResponse != nil { + payloadCollection.HttpResponse = &instrumentationrules.HttpPayloadCollection{} + } + + if input.PayloadCollection.DbQuery != nil { + payloadCollection.DbQuery = &instrumentationrules.DbQueryPayloadCollection{} + } + + if input.PayloadCollection.Messaging != nil { + payloadCollection.Messaging = &instrumentationrules.MessagingPayloadCollection{} + } + + existingRule.Spec.PayloadCollection = payloadCollection + } else { + existingRule.Spec.PayloadCollection = nil + } + + // Update rule in Kubernetes + updatedRule, err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).Update(ctx, existingRule, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("error updating instrumentation rule: %w", err) + } + + return &model.InstrumentationRule{ + RuleID: updatedRule.Name, + RuleName: &updatedRule.Spec.RuleName, + Notes: &updatedRule.Spec.Notes, + Disabled: &updatedRule.Spec.Disabled, + Workloads: convertWorkloads(updatedRule.Spec.Workloads), + InstrumentationLibraries: convertInstrumentationLibraries(updatedRule.Spec.InstrumentationLibraries), + PayloadCollection: convertPayloadCollection(updatedRule.Spec.PayloadCollection), + }, nil +} + +func DeleteInstrumentationRule(ctx context.Context, id string) (bool, error) { + odigosns := consts.DefaultOdigosNamespace + + err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).Delete(ctx, id, metav1.DeleteOptions{}) + if err != nil { + return false, handleNotFoundError(err, id, "instrumentation rule") + } + + return true, nil +} + +func CreateInstrumentationRule(ctx context.Context, input model.InstrumentationRuleInput) (*model.InstrumentationRule, error) { + odigosns := consts.DefaultOdigosNamespace + + ruleName := *input.RuleName + notes := *input.Notes + disabled := *input.Disabled + + var workloads *[]workload.PodWorkload + if input.Workloads != nil { + convertedWorkloads := make([]workload.PodWorkload, len(input.Workloads)) + for i, w := range input.Workloads { + convertedWorkloads[i] = workload.PodWorkload{ + Name: w.Name, + Namespace: w.Namespace, + Kind: workload.WorkloadKind(w.Kind), + } + } + workloads = &convertedWorkloads + } + var instrumentationLibraries *[]v1alpha1.InstrumentationLibraryGlobalId + if input.InstrumentationLibraries != nil { + convertedLibraries := make([]v1alpha1.InstrumentationLibraryGlobalId, len(input.InstrumentationLibraries)) + for i, lib := range input.InstrumentationLibraries { + convertedLibraries[i] = v1alpha1.InstrumentationLibraryGlobalId{ + Name: lib.Name, + SpanKind: common.SpanKind(*lib.SpanKind), + Language: common.ProgrammingLanguage(*lib.Language), + } + } + instrumentationLibraries = &convertedLibraries + } + + var payloadCollection *instrumentationrules.PayloadCollection + if input.PayloadCollection != nil { + payloadCollection = &instrumentationrules.PayloadCollection{} + + if input.PayloadCollection.HTTPRequest != nil { + payloadCollection.HttpRequest = &instrumentationrules.HttpPayloadCollection{} + } + + if input.PayloadCollection.HTTPResponse != nil { + payloadCollection.HttpResponse = &instrumentationrules.HttpPayloadCollection{} + } + + if input.PayloadCollection.DbQuery != nil { + payloadCollection.DbQuery = &instrumentationrules.DbQueryPayloadCollection{} + } + + if input.PayloadCollection.Messaging != nil { + payloadCollection.Messaging = &instrumentationrules.MessagingPayloadCollection{} + } + } + + // Define the new rule spec based on the input + newRule := &v1alpha1.InstrumentationRule{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "ui-instrumentation-rule-", + }, + Spec: v1alpha1.InstrumentationRuleSpec{ + RuleName: ruleName, + Notes: notes, + Disabled: disabled, + Workloads: workloads, + InstrumentationLibraries: instrumentationLibraries, + PayloadCollection: payloadCollection, + }, + } + + // Create the rule in Kubernetes + createdRule, err := kube.DefaultClient.OdigosClient.InstrumentationRules(odigosns).Create(ctx, newRule, metav1.CreateOptions{}) + if err != nil { + return nil, fmt.Errorf("error creating instrumentation rule: %w", err) + } + // Convert to GraphQL model and return + return &model.InstrumentationRule{ + RuleID: createdRule.Name, + }, nil +} + +func handleNotFoundError(err error, id string, entity string) error { + if apierrors.IsNotFound(err) { + return fmt.Errorf("%s with ID %s not found", entity, id) + } + return fmt.Errorf("error getting %s: %w", entity, err) +} + +// Converts Workloads to GraphQL-compatible format +func convertWorkloads(workloads *[]workload.PodWorkload) []*model.PodWorkload { + var gqlWorkloads []*model.PodWorkload + if workloads != nil { + for _, w := range *workloads { + gqlWorkloads = append(gqlWorkloads, &model.PodWorkload{ + Namespace: w.Namespace, + Kind: model.K8sResourceKind(w.Kind), + Name: w.Name, + }) + } + } + return gqlWorkloads +} + +// Converts InstrumentationLibraries to GraphQL-compatible format +func convertInstrumentationLibraries(libraries *[]v1alpha1.InstrumentationLibraryGlobalId) []*model.InstrumentationLibraryGlobalID { + var gqlLibraries []*model.InstrumentationLibraryGlobalID + if libraries != nil { + for _, lib := range *libraries { + spanKind := model.SpanKind(lib.SpanKind) + language := model.ProgrammingLanguage(lib.Language) + gqlLibraries = append(gqlLibraries, &model.InstrumentationLibraryGlobalID{ + Name: lib.Name, + SpanKind: &spanKind, + Language: &language, + }) + } + } + return gqlLibraries +} + +// Converts PayloadCollection to GraphQL-compatible format +func convertPayloadCollection(payload *instrumentationrules.PayloadCollection) *model.PayloadCollection { + if payload == nil { + return nil + } + + return &model.PayloadCollection{ + HTTPRequest: toHTTPPayload(payload.HttpRequest), + HTTPResponse: toHTTPPayload(payload.HttpResponse), + DbQuery: toDbQueryPayload(payload.DbQuery), + Messaging: toMessagingPayload(payload.Messaging), + } +} + +// Helpers to create empty payloads if they exist +func toHTTPPayload(payload *instrumentationrules.HttpPayloadCollection) *model.HTTPPayloadCollection { + if payload == nil { + return nil + } + return &model.HTTPPayloadCollection{} +} + +func toDbQueryPayload(payload *instrumentationrules.DbQueryPayloadCollection) *model.DbQueryPayloadCollection { + if payload == nil { + return nil + } + return &model.DbQueryPayloadCollection{} +} + +func toMessagingPayload(payload *instrumentationrules.MessagingPayloadCollection) *model.MessagingPayloadCollection { + if payload == nil { + return nil + } + return &model.MessagingPayloadCollection{} +} diff --git a/frontend/services/namespaces.go b/frontend/services/namespaces.go new file mode 100644 index 000000000..534249c90 --- /dev/null +++ b/frontend/services/namespaces.go @@ -0,0 +1,190 @@ +package services + +import ( + "context" + "fmt" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/k8sutils/pkg/client" + "sigs.k8s.io/yaml" + + "k8s.io/apimachinery/pkg/runtime/schema" + + "golang.org/x/sync/errgroup" + + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/common/utils" + + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type GetNamespacesResponse struct { + Namespaces []GetNamespaceItem `json:"namespaces"` +} + +type GetNamespaceItem struct { + Name string `json:"name"` + Selected bool `json:"selected"` + TotalApps int `json:"totalApps"` +} + +const ( + OdigosSystemNamespace = "odigos-system" +) + +func GetK8SNamespaces(ctx context.Context) GetNamespacesResponse { + + var ( + relevantNameSpaces []v1.Namespace + appsPerNamespace map[string]int + ) + + g, ctx := errgroup.WithContext(ctx) + g.Go(func() error { + var err error + relevantNameSpaces, err = getRelevantNameSpaces(ctx, OdigosSystemNamespace) + return err + }) + + g.Go(func() error { + var err error + appsPerNamespace, err = CountAppsPerNamespace(ctx) + return err + }) + + if err := g.Wait(); err != nil { + + return GetNamespacesResponse{} + } + + var response GetNamespacesResponse + for _, namespace := range relevantNameSpaces { + // check if entire namespace is instrumented + selected := namespace.Labels[consts.OdigosInstrumentationLabel] == consts.InstrumentationEnabled + + response.Namespaces = append(response.Namespaces, GetNamespaceItem{ + Name: namespace.Name, + Selected: selected, + TotalApps: appsPerNamespace[namespace.Name], + }) + } + + return response +} + +// getRelevantNameSpaces returns a list of namespaces that are relevant for instrumentation. +// Taking into account the ignored namespaces from the OdigosConfiguration. +func getRelevantNameSpaces(ctx context.Context, odigosns string) ([]v1.Namespace, error) { + var ( + odigosConfig *common.OdigosConfiguration + list *v1.NamespaceList + ) + + g, ctx := errgroup.WithContext(ctx) + g.Go(func() error { + var err error + configMap, err := kube.DefaultClient.CoreV1().ConfigMaps(odigosns).Get(ctx, consts.OdigosConfigurationName, metav1.GetOptions{}) + if err != nil { + return err + } + if err := yaml.Unmarshal([]byte(configMap.Data[consts.OdigosConfigurationFileName]), &odigosConfig); err != nil { + return err + } + return err + }) + + g.Go(func() error { + var err error + list, err = kube.DefaultClient.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) + return err + }) + + if err := g.Wait(); err != nil { + return []v1.Namespace{}, err + } + + result := []v1.Namespace{} + for _, namespace := range list.Items { + if utils.IsItemIgnored(namespace.Name, odigosConfig.IgnoredNamespaces) { + continue + } + + result = append(result, namespace) + } + + return result, nil +} + +type PersistNamespaceItem struct { + Name string `json:"name"` + SelectedAll bool `json:"selected_all"` + FutureSelected *bool `json:"future_selected,omitempty"` + Objects []PersistNamespaceObject `json:"objects"` +} + +type PersistNamespaceObject struct { + Name string `json:"name"` + Kind WorkloadKind `json:"kind"` + Selected *bool `json:"selected,omitempty"` +} + +// returns a map, where the key is a namespace name and the value is the +// number of apps in this namespace (not necessarily instrumented) +func CountAppsPerNamespace(ctx context.Context) (map[string]int, error) { + namespaceToAppsCount := make(map[string]int) + + resourceTypes := []string{"deployments", "statefulsets", "daemonsets"} + + for _, resourceType := range resourceTypes { + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.MetadataClient.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: resourceType, + }).List, ctx, metav1.ListOptions{}, func(list *metav1.PartialObjectMetadataList) error { + for _, item := range list.Items { + namespaceToAppsCount[item.Namespace]++ + } + return nil + }) + + if err != nil { + return nil, fmt.Errorf("failed to count %s: %w", resourceType, err) + } + } + + return namespaceToAppsCount, nil +} + +func GetJsonMergePatchForInstrumentationLabel(enabled *bool) []byte { + labelJsonMergePatchValue := "null" + if enabled != nil { + if *enabled { + labelJsonMergePatchValue = fmt.Sprintf("\"%s\"", consts.InstrumentationEnabled) + } else { + labelJsonMergePatchValue = fmt.Sprintf("\"%s\"", consts.InstrumentationDisabled) + } + } + + jsonMergePatchContent := fmt.Sprintf(`{"metadata":{"labels":{"%s":%s}}}`, consts.OdigosInstrumentationLabel, labelJsonMergePatchValue) + return []byte(jsonMergePatchContent) +} + +func SyncWorkloadsInNamespace(ctx context.Context, nsName string, workloads []model.PersistNamespaceSourceInput) error { + g, ctx := errgroup.WithContext(ctx) + g.SetLimit(kube.K8sClientDefaultBurst) + + for _, workload := range workloads { + currWorkload := workload + g.Go(func() error { + // Only label selected sources, ignore the rest + if currWorkload.Selected != nil { + return setWorkloadInstrumentationLabel(ctx, nsName, currWorkload.Name, WorkloadKind(currWorkload.Kind.String()), currWorkload.Selected) + } + return nil + }) + } + return g.Wait() +} diff --git a/frontend/services/sources.go b/frontend/services/sources.go new file mode 100644 index 000000000..2a9d0992f --- /dev/null +++ b/frontend/services/sources.go @@ -0,0 +1,382 @@ +package services + +import ( + "context" + "fmt" + "time" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/kube" + + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + appsv1 "k8s.io/api/apps/v1" + + "github.com/odigos-io/odigos/frontend/graph/model" + + "github.com/odigos-io/odigos/k8sutils/pkg/client" + + "golang.org/x/sync/errgroup" + corev1 "k8s.io/api/core/v1" +) + +type WorkloadKind string + +const ( + WorkloadKindDeployment WorkloadKind = "Deployment" + WorkloadKindStatefulSet WorkloadKind = "StatefulSet" + WorkloadKindDaemonSet WorkloadKind = "DaemonSet" +) + +type SourceLanguage struct { + ContainerName string `json:"container_name"` + Language string `json:"language"` +} + +type InstrumentedApplicationDetails struct { + Languages []SourceLanguage `json:"languages,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} +type SourceID struct { + // combination of namespace, kind and name is unique + Name string `json:"name"` + Kind string `json:"kind"` + Namespace string `json:"namespace"` +} + +type Source struct { + ThinSource + ReportedName string `json:"reported_name,omitempty"` +} + +type PatchSourceRequest struct { + ReportedName *string `json:"reported_name"` +} + +// this object contains only part of the source fields. It is used to display the sources in the frontend +type ThinSource struct { + SourceID + NumberOfRunningInstances int `json:"number_of_running_instances"` + IaDetails *InstrumentedApplicationDetails `json:"instrumented_application_details"` +} + +func GetActualSource(ctx context.Context, ns string, kind string, name string) (*Source, error) { + k8sObjectName := workload.CalculateWorkloadRuntimeObjectName(name, kind) + owner, numberOfRunningInstances := GetWorkload(ctx, ns, kind, name) + if owner == nil { + return nil, fmt.Errorf("owner not found") + } + ownerAnnotations := owner.GetAnnotations() + var reportedName string + if ownerAnnotations != nil { + reportedName = ownerAnnotations[consts.OdigosReportedNameAnnotation] + } + + ts := ThinSource{ + SourceID: SourceID{ + Namespace: ns, + Kind: kind, + Name: name, + }, + NumberOfRunningInstances: numberOfRunningInstances, + } + + instrumentedApplication, err := kube.DefaultClient.OdigosClient.InstrumentedApplications(ns).Get(ctx, k8sObjectName, metav1.GetOptions{}) + if err == nil { + ts.IaDetails = k8sInstrumentedAppToThinSource(instrumentedApplication).IaDetails + err = addHealthyInstrumentationInstancesCondition(ctx, instrumentedApplication, &ts) + if err != nil { + return nil, err + } + } + + return &Source{ + ThinSource: ts, + ReportedName: reportedName, + }, nil +} + +func GetWorkload(c context.Context, ns string, kind string, name string) (metav1.Object, int) { + switch kind { + case "Deployment": + deployment, err := kube.DefaultClient.AppsV1().Deployments(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return deployment, int(deployment.Status.AvailableReplicas) + case "StatefulSet": + statefulSet, err := kube.DefaultClient.AppsV1().StatefulSets(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return statefulSet, int(statefulSet.Status.ReadyReplicas) + case "DaemonSet": + daemonSet, err := kube.DefaultClient.AppsV1().DaemonSets(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return daemonSet, int(daemonSet.Status.NumberReady) + default: + return nil, 0 + } +} + +func addHealthyInstrumentationInstancesCondition(ctx context.Context, app *v1alpha1.InstrumentedApplication, source *ThinSource) error { + labelSelector := fmt.Sprintf("%s=%s", consts.InstrumentedAppNameLabel, app.Name) + instancesList, err := kube.DefaultClient.OdigosClient.InstrumentationInstances(app.Namespace).List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + return err + } + + totalInstances := len(instancesList.Items) + if totalInstances == 0 { + // no instances so nothing to report + return nil + } + + healthyInstances := 0 + latestStatusTime := metav1.NewTime(time.Time{}) + for _, instance := range instancesList.Items { + if instance.Status.Healthy != nil && *instance.Status.Healthy { + healthyInstances++ + } + if instance.Status.LastStatusTime.After(latestStatusTime.Time) { + latestStatusTime = instance.Status.LastStatusTime + } + } + + status := metav1.ConditionTrue + if healthyInstances < totalInstances { + status = metav1.ConditionFalse + } + + source.IaDetails.Conditions = append(source.IaDetails.Conditions, metav1.Condition{ + Type: "HealthyInstrumentationInstances", + Status: status, + LastTransitionTime: latestStatusTime, + Message: fmt.Sprintf("%d/%d instances are healthy", healthyInstances, totalInstances), + }) + + return nil +} + +func k8sInstrumentedAppToThinSource(app *v1alpha1.InstrumentedApplication) ThinSource { + var source ThinSource + source.Name = app.OwnerReferences[0].Name + source.Kind = app.OwnerReferences[0].Kind + source.Namespace = app.Namespace + var conditions []metav1.Condition + for _, condition := range app.Status.Conditions { + conditions = append(conditions, metav1.Condition{ + Type: condition.Type, + Status: condition.Status, + Message: condition.Message, + LastTransitionTime: condition.LastTransitionTime, + }) + } + source.IaDetails = &InstrumentedApplicationDetails{ + Languages: []SourceLanguage{}, + Conditions: conditions, + } + for _, language := range app.Spec.RuntimeDetails { + source.IaDetails.Languages = append(source.IaDetails.Languages, SourceLanguage{ + ContainerName: language.ContainerName, + Language: string(language.Language), + }) + } + return source +} + +func GetWorkloadsInNamespace(ctx context.Context, nsName string, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, nsName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + g, ctx := errgroup.WithContext(ctx) + var ( + deps []model.K8sActualSource + ss []model.K8sActualSource + dss []model.K8sActualSource + ) + + g.Go(func() error { + var err error + deps, err = getDeployments(ctx, *namespace, instrumentationLabeled) + return err + }) + + g.Go(func() error { + var err error + ss, err = getStatefulSets(ctx, *namespace, instrumentationLabeled) + return err + }) + + g.Go(func() error { + var err error + dss, err = getDaemonSets(ctx, *namespace, instrumentationLabeled) + return err + }) + + if err := g.Wait(); err != nil { + return nil, err + } + + items := make([]model.K8sActualSource, len(deps)+len(ss)+len(dss)) + copy(items, deps) + copy(items[len(deps):], ss) + copy(items[len(deps)+len(ss):], dss) + + return items, nil +} + +func getDeployments(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().Deployments(namespace.Name).List, ctx, metav1.ListOptions{}, func(deps *appsv1.DeploymentList) error { + for _, dep := range deps.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(dep.GetLabels(), string(WorkloadKindDeployment), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(dep.Status.ReadyReplicas) + response = append(response, model.K8sActualSource{ + Namespace: dep.Namespace, + Name: dep.Name, + Kind: k8sKindToGql(string(WorkloadKindDeployment)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func getDaemonSets(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().DaemonSets(namespace.Name).List, ctx, metav1.ListOptions{}, func(dss *appsv1.DaemonSetList) error { + for _, ds := range dss.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(ds.GetLabels(), string(WorkloadKindDaemonSet), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(ds.Status.NumberReady) + response = append(response, model.K8sActualSource{ + Namespace: ds.Namespace, + Name: ds.Name, + Kind: k8sKindToGql(string(WorkloadKindDaemonSet)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func getStatefulSets(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().StatefulSets(namespace.Name).List, ctx, metav1.ListOptions{}, func(sss *appsv1.StatefulSetList) error { + for _, ss := range sss.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(ss.GetLabels(), string(WorkloadKindStatefulSet), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(ss.Status.ReadyReplicas) + response = append(response, model.K8sActualSource{ + Namespace: ss.Namespace, + Name: ss.Name, + Kind: k8sKindToGql(string(WorkloadKindStatefulSet)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func k8sKindToGql(k8sResourceKind string) model.K8sResourceKind { + switch k8sResourceKind { + case "Deployment": + return model.K8sResourceKindDeployment + case "StatefulSet": + return model.K8sResourceKindStatefulSet + case "DaemonSet": + return model.K8sResourceKindDaemonSet + } + return "" +} + +func UpdateReportedName( + ctx context.Context, + ns, kind, name, reportedName string, +) error { + switch kind { + case "Deployment": + deployment, err := kube.DefaultClient.AppsV1().Deployments(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find deployment: %w", err) + } + deployment.SetAnnotations(updateAnnotations(deployment.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().Deployments(ns).Update(ctx, deployment, metav1.UpdateOptions{}) + return err + case "StatefulSet": + statefulSet, err := kube.DefaultClient.AppsV1().StatefulSets(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find statefulset: %w", err) + } + statefulSet.SetAnnotations(updateAnnotations(statefulSet.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().StatefulSets(ns).Update(ctx, statefulSet, metav1.UpdateOptions{}) + return err + case "DaemonSet": + daemonSet, err := kube.DefaultClient.AppsV1().DaemonSets(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find daemonset: %w", err) + } + daemonSet.SetAnnotations(updateAnnotations(daemonSet.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().DaemonSets(ns).Update(ctx, daemonSet, metav1.UpdateOptions{}) + return err + default: + return fmt.Errorf("unsupported kind: %s", kind) + } +} + +func updateAnnotations(annotations map[string]string, reportedName string) map[string]string { + if annotations == nil { + annotations = make(map[string]string) + } + if reportedName == "" { + delete(annotations, consts.OdigosReportedNameAnnotation) + } else { + annotations[consts.OdigosReportedNameAnnotation] = reportedName + } + return annotations +} diff --git a/frontend/services/test_connection/conversion.go b/frontend/services/test_connection/conversion.go new file mode 100644 index 000000000..aa26d882b --- /dev/null +++ b/frontend/services/test_connection/conversion.go @@ -0,0 +1,58 @@ +package testconnection + +import ( + "errors" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + "github.com/odigos-io/odigos/frontend/graph/model" +) + +// Implement the ExporterConfigurer interface +type DestinationConfigurer struct { + destination model.DestinationInput +} + +func (dc *DestinationConfigurer) GetSignals() []common.ObservabilitySignal { + var signals []common.ObservabilitySignal + if dc.destination.ExportedSignals.Traces { + signals = append(signals, common.TracesObservabilitySignal) + } + if dc.destination.ExportedSignals.Metrics { + signals = append(signals, common.MetricsObservabilitySignal) + } + if dc.destination.ExportedSignals.Logs { + signals = append(signals, common.LogsObservabilitySignal) + } + return signals +} + +func (dc *DestinationConfigurer) GetType() common.DestinationType { + // Convert the string type to common.DestinationType + return common.DestinationType(dc.destination.Type) +} + +func (dc *DestinationConfigurer) GetID() string { + // Generate a unique ID for the Exporter, you can base this on the destination name or type + return dc.destination.Name +} + +func (dc *DestinationConfigurer) GetConfig() map[string]string { + configMap := make(map[string]string) + for _, field := range dc.destination.Fields { + configMap[field.Key] = field.Value + } + return configMap +} + +func ConvertDestinationToConfigurer(destination model.DestinationInput) (config.ExporterConfigurer, error) { + + if destination.Type == "" { + return nil, errors.New("destination type is required") + } + + // Additional validation or conversion logic can be added here if needed + + // Return a new instance of DestinationConfigurer which implements ExporterConfigurer + return &DestinationConfigurer{destination: destination}, nil +} diff --git a/frontend/services/test_connection/otlp_test_connection.go b/frontend/services/test_connection/otlp_test_connection.go new file mode 100644 index 000000000..6a137e31b --- /dev/null +++ b/frontend/services/test_connection/otlp_test_connection.go @@ -0,0 +1,37 @@ +package testconnection + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" + + "go.opentelemetry.io/collector/exporter/otlpexporter" +) + +var _ ExporterConnectionTester = &otlpExporterConnectionTester{} + +type otlpExporterConnectionTester struct { + f exporter.Factory +} + +func NewOTLPTester() *otlpExporterConnectionTester { + return &otlpExporterConnectionTester{ + f: otlpexporter.NewFactory(), + } +} + +func (t *otlpExporterConnectionTester) Factory() exporter.Factory { + return t.f +} + +func (t *otlpExporterConnectionTester) ModifyConfigForConnectionTest(cfg component.Config) component.Config { + otlpConf, ok := cfg.(*otlpexporter.Config) + if !ok { + return nil + } + + // currently using the default timeout config of the collector - 5 seconds + // Avoid batching and retries + otlpConf.QueueConfig.Enabled = false + otlpConf.RetryConfig.Enabled = false + return otlpConf +} diff --git a/frontend/services/test_connection/otlphttp_test_connection.go b/frontend/services/test_connection/otlphttp_test_connection.go new file mode 100644 index 000000000..42c12c166 --- /dev/null +++ b/frontend/services/test_connection/otlphttp_test_connection.go @@ -0,0 +1,36 @@ +package testconnection + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/otlphttpexporter" +) + +var _ ExporterConnectionTester = &otlphttpExporterConnectionTester{} + +type otlphttpExporterConnectionTester struct { + f exporter.Factory +} + +func NewOTLPHTTPTester() *otlphttpExporterConnectionTester { + return &otlphttpExporterConnectionTester{ + f: otlphttpexporter.NewFactory(), + } +} + +func (t *otlphttpExporterConnectionTester) Factory() exporter.Factory { + return t.f +} + +func (t *otlphttpExporterConnectionTester) ModifyConfigForConnectionTest(cfg component.Config) component.Config { + otlpConf, ok := cfg.(*otlphttpexporter.Config) + if !ok { + return nil + } + + // currently using the default timeout config of the collector - 5 seconds + // Avoid batching and retries + otlpConf.QueueConfig.Enabled = false + otlpConf.RetryConfig.Enabled = false + return otlpConf +} diff --git a/frontend/services/test_connection/test_connection.go b/frontend/services/test_connection/test_connection.go new file mode 100644 index 000000000..6c078f29a --- /dev/null +++ b/frontend/services/test_connection/test_connection.go @@ -0,0 +1,157 @@ +package testconnection + +import ( + "context" + "fmt" + "net/http" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +var ( + configres map[common.DestinationType]config.Configer + connectionTesters = []ExporterConnectionTester{ + NewOTLPTester(), // "otlp/" prefix + NewOTLPHTTPTester(), // "otlphttp/" prefix + } +) + +func init() { + var err error + configres, err = config.LoadConfigers() + if err != nil { + panic(1) + } +} + +type TestConnectionErrorReason string + +const ( + UnKnownDestination TestConnectionErrorReason = "unknown destination" + InvalidConfig TestConnectionErrorReason = "invalid config" + UnsupportedExporterType TestConnectionErrorReason = "unsupported exporter type" + FailedToConnect TestConnectionErrorReason = "failed to connect" +) + +type TestConnectionResult struct { + Succeeded bool + Message string + Reason TestConnectionErrorReason + StatusCode int + DestinationType common.DestinationType +} + +type ExporterConnectionTester interface { + // Factory returns the exporter factory for the exporter type. + // This is used to create the exporter instance for testing the connection. + Factory() exporter.Factory + // ModifyConfigForConnectionTest modifies the exporter configuration for testing the connection. + // Since the default configuration may have batching, retries, etc. which may not be suitable for testing the connection. + ModifyConfigForConnectionTest(component.Config) component.Config +} + +func getConnectionTester(exporterID string) ExporterConnectionTester { + for _, tester := range connectionTesters { + prefix := fmt.Sprintf("%s/", tester.Factory().Type().String()) + if strings.HasPrefix(exporterID, prefix) { + return tester + } + } + return nil +} + +func TestConnection(ctx context.Context, dest config.ExporterConfigurer) TestConnectionResult { + destType := dest.GetType() + configer, ok := configres[destType] + if !ok { + return TestConnectionResult{Succeeded: false, Reason: UnKnownDestination, DestinationType: destType, StatusCode: http.StatusNotImplemented} + } + + currentConfig := config.Config{ + Exporters: make(config.GenericMap), + Service: config.Service{ + Pipelines: make(map[string]config.Pipeline), + }, + } + err := configer.ModifyConfig(dest, ¤tConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + exporters := currentConfig.Exporters + if len(exporters) == 0 { + return TestConnectionResult{Message: "no exporters found in config", Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError, Succeeded: false} + } + + var exporterRawConfig config.GenericMap + var connectionTester ExporterConnectionTester + foundTester := false + for componentID, cfg := range exporters { + gm, ok := cfg.(config.GenericMap) + if !ok { + continue + } + ct := getConnectionTester(componentID) + if ct != nil { + connectionTester = ct + foundTester = true + exporterRawConfig = gm + break + } + } + + if !foundTester { + return TestConnectionResult{Succeeded: false, Message: "no supported exporter found in config", Reason: UnsupportedExporterType, DestinationType: destType, StatusCode: http.StatusNotFound} + } + + // before testing the connection, replace placeholders (if exists) in the config with actual values + replacePlaceholders(exporterRawConfig, dest.GetConfig()) + defaultConfig := connectionTester.Factory().CreateDefaultConfig() + connectionTester.ModifyConfigForConnectionTest(defaultConfig) + + // convert the user provided fields to a collector config + exportersConf := confmap.NewFromStringMap(exporterRawConfig) + if exportersConf == nil { + return TestConnectionResult{Succeeded: false, Message: "failed to create exporter config", Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + // unmarshal the user provided configuration into the default one, merging them + err = exportersConf.Unmarshal(&defaultConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + if validator, ok := defaultConfig.(component.ConfigValidator); ok { + // if the component has a Validate method, call it to validate the configuration + err = validator.Validate() + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + } + + exporter, err := connectionTester.Factory().CreateTracesExporter(ctx, exportertest.NewNopSettings(), defaultConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + err = exporter.Start(ctx, nil) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: FailedToConnect, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + defer exporter.Shutdown(ctx) + err = exporter.ConsumeTraces(ctx, ptrace.NewTraces()) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: FailedToConnect, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + return TestConnectionResult{Succeeded: true, DestinationType: destType, StatusCode: http.StatusOK} +} diff --git a/frontend/services/test_connection/utils.go b/frontend/services/test_connection/utils.go new file mode 100644 index 000000000..aca670899 --- /dev/null +++ b/frontend/services/test_connection/utils.go @@ -0,0 +1,43 @@ +package testconnection + +import ( + "regexp" + "strings" + + "github.com/odigos-io/odigos/common/config" +) + +// replacePlaceholders replaces placeholder values in the given GenericMap with values from the fields map. +// It traverses the GenericMap recursively and processes each string value as a template. +// If a string value contains placeholders in the format {KEY}, it replaces them with corresponding values from the fields map. +// The function supports nested GenericMaps and map[string]interface{} structures. +func replacePlaceholders(gmap config.GenericMap, fields map[string]string) { + // Regular expression to match the ${KEY} pattern + re := regexp.MustCompile(`\$\{([^}]+)\}`) + + for key, value := range gmap { + switch v := value.(type) { + case string: + // Find all matches of the pattern ${KEY} + matches := re.FindAllStringSubmatch(v, -1) + for _, match := range matches { + if len(match) == 2 { + // match[0] is the entire match (${KEY}), match[1] is the key (KEY) + extractedKey := match[1] + if replacement, ok := fields[extractedKey]; ok { + // Replace only the ${KEY} part in the original string + v = strings.Replace(v, match[0], replacement, -1) + // Update the map with the new value + gmap[key] = v + } + } + } + case config.GenericMap: + replacePlaceholders(v, fields) + case map[string]interface{}: + replacePlaceholders(v, fields) + default: + // If the value is not a string or a map, we leave it as it is + } + } +} \ No newline at end of file diff --git a/frontend/services/test_connection/utils_test.go b/frontend/services/test_connection/utils_test.go new file mode 100644 index 000000000..48787fc9c --- /dev/null +++ b/frontend/services/test_connection/utils_test.go @@ -0,0 +1,56 @@ +package testconnection + +import ( + "testing" + + "github.com/odigos-io/odigos/common/config" + "github.com/stretchr/testify/assert" +) + +func TestReplacePlaceholders(t *testing.T) { + // Fields map with replacements + fields := map[string]string{ + "MY_KEY1": "MY_VALUE1", + "MY_KEY2": "MY_VALUE2", + } + + gmap := config.GenericMap{ + "key1": "${MY_KEY1}", + "key2": 123, + "key3": config.GenericMap{ + "nestedKey1": "${MY_KEY2}", // replaced with MY_VALUE2 + "nestedKey2": "someValue", // no replacement + "nestedKey3": "${MY_KEY3}", // no replacement + "nestedKey4": "some prefix: ${MY_KEY2}", // replaced with "some prefix: MY_VALUE2" + }, + } + + replacePlaceholders(gmap, fields) + assert.Equal(t, "MY_VALUE1", gmap["key1"]) + assert.Equal(t, config.GenericMap{ + "nestedKey1": "MY_VALUE2", + "nestedKey2": "someValue", + "nestedKey3": "${MY_KEY3}", + "nestedKey4": "some prefix: MY_VALUE2", + }, gmap["key3"]) + assert.Equal(t, 123, gmap["key2"]) + + // don't change the original map if no placeholders are found + gmap = config.GenericMap{ + "key1": "value1", + "key2": 123, + "key3": config.GenericMap{ + "nestedKey1": "value2", + "nestedKey2": "someValue", + }, + } + + replacePlaceholders(gmap, fields) + assert.Equal(t, "value1", gmap["key1"]) + assert.Equal(t, config.GenericMap{ + "nestedKey1": "value2", + "nestedKey2": "someValue", + }, gmap["key3"]) + assert.Equal(t, 123, gmap["key2"]) + +} \ No newline at end of file diff --git a/frontend/services/utils.go b/frontend/services/utils.go new file mode 100644 index 000000000..bf0b7db2c --- /dev/null +++ b/frontend/services/utils.go @@ -0,0 +1,80 @@ +package services + +import ( + "context" + "errors" + "fmt" + "path" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +const cdnUrl = "https://d15jtxgb40qetw.cloudfront.net" + +func GetImageURL(image string) string { + return path.Join(cdnUrl, image) +} + +func setWorkloadInstrumentationLabel(ctx context.Context, nsName string, workloadName string, workloadKind WorkloadKind, enabled *bool) error { + jsonMergePatchData := GetJsonMergePatchForInstrumentationLabel(enabled) + + switch workloadKind { + case WorkloadKindDeployment: + _, err := kube.DefaultClient.AppsV1().Deployments(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + case WorkloadKindStatefulSet: + _, err := kube.DefaultClient.AppsV1().StatefulSets(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + case WorkloadKindDaemonSet: + _, err := kube.DefaultClient.AppsV1().DaemonSets(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + default: + return errors.New("unsupported workload kind " + string(workloadKind)) + } +} + +func ConvertFieldsToString(fields map[string]string) string { + if len(fields) == 0 { + return "" + } + + var parts []string + for key, value := range fields { + parts = append(parts, fmt.Sprintf("%s: %s", key, value)) + } + + return strings.Join(parts, ", ") +} + +func ConvertSignals(signals []model.SignalType) ([]common.ObservabilitySignal, error) { + var result []common.ObservabilitySignal + for _, s := range signals { + switch s { + case model.SignalTypeTraces: + result = append(result, common.TracesObservabilitySignal) + case model.SignalTypeMetrics: + result = append(result, common.MetricsObservabilitySignal) + case model.SignalTypeLogs: + result = append(result, common.LogsObservabilitySignal) + default: + return nil, fmt.Errorf("unknown signal type: %v", s) + } + } + return result, nil +} + +func DerefString(s *string) string { + if s != nil { + return *s + } + return "" +} + +func StringPtr(s string) *string { + return &s +} diff --git a/frontend/webapp/.babelrc b/frontend/webapp/.babelrc deleted file mode 100644 index 854cb73a8..000000000 --- a/frontend/webapp/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [["styled-components", { "ssr": true }]] -} diff --git a/frontend/webapp/.eslintrc.json b/frontend/webapp/.eslintrc.json index a8cdd12f5..957cd1545 100644 --- a/frontend/webapp/.eslintrc.json +++ b/frontend/webapp/.eslintrc.json @@ -1,6 +1,3 @@ { - "extends": "next/core-web-vitals", - "rules": { - "quotes": ["error", "single", { "avoidEscape": true }] - } + "extends": ["next/core-web-vitals"] } diff --git a/frontend/webapp/.prettierrc b/frontend/webapp/.prettierrc new file mode 100644 index 000000000..4c3bab277 --- /dev/null +++ b/frontend/webapp/.prettierrc @@ -0,0 +1,13 @@ +{ + "tabWidth": 2, + "printWidth": 200, + "semi": true, + "singleQuote": true, + "jsxSingleQuote": true, + "quoteProps": "as-needed", + "trailingComma": "all", + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParens": "always", + "parser": "typescript" +} \ No newline at end of file diff --git a/frontend/webapp/README.md b/frontend/webapp/README.md index 03b032991..66cb22e28 100644 --- a/frontend/webapp/README.md +++ b/frontend/webapp/README.md @@ -22,8 +22,6 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the pages by modifying `app` folder. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. - ## Learn More To learn more about Next.js, take a look at the following resources: diff --git a/frontend/webapp/app/(overview)/(actions)/actions/page.tsx b/frontend/webapp/app/(overview)/(actions)/actions/page.tsx deleted file mode 100644 index 1cbb523f3..000000000 --- a/frontend/webapp/app/(overview)/(actions)/actions/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { OverviewHeader } from '@/components'; -import { ManagedActionsContainer } from '@/containers'; - -export default function ActionsPage() { - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(actions)/choose-action/page.tsx b/frontend/webapp/app/(overview)/(actions)/choose-action/page.tsx deleted file mode 100644 index c193b1d6e..000000000 --- a/frontend/webapp/app/(overview)/(actions)/choose-action/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { ChooseActionContainer } from '@/containers'; - -export default function ChooseActionPage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(actions)/create-action/page.tsx b/frontend/webapp/app/(overview)/(actions)/create-action/page.tsx deleted file mode 100644 index 98dc681bb..000000000 --- a/frontend/webapp/app/(overview)/(actions)/create-action/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { CreateActionContainer } from '@/containers'; - -export default function CreateActionPage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(actions)/edit-action/page.tsx b/frontend/webapp/app/(overview)/(actions)/edit-action/page.tsx deleted file mode 100644 index d1f30be50..000000000 --- a/frontend/webapp/app/(overview)/(actions)/edit-action/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { EditActionContainer } from '@/containers'; - -export default function EditActionPage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(destinations)/create-destination/page.tsx b/frontend/webapp/app/(overview)/(destinations)/create-destination/page.tsx deleted file mode 100644 index 8d060907b..000000000 --- a/frontend/webapp/app/(overview)/(destinations)/create-destination/page.tsx +++ /dev/null @@ -1,6 +0,0 @@ -'use client'; -import { NewDestinationForm } from '@/containers/main'; - -export default function CreateNewDestinationPage() { - return ; -} diff --git a/frontend/webapp/app/(overview)/(destinations)/destinations/page.tsx b/frontend/webapp/app/(overview)/(destinations)/destinations/page.tsx deleted file mode 100644 index 87ea0e365..000000000 --- a/frontend/webapp/app/(overview)/(destinations)/destinations/page.tsx +++ /dev/null @@ -1,13 +0,0 @@ -'use client'; -import { OVERVIEW } from '@/utils'; -import { OverviewHeader } from '@/components'; -import { DestinationContainer } from '@/containers'; - -export default function DestinationDashboardPage() { - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(destinations)/edit-destination/page.tsx b/frontend/webapp/app/(overview)/(destinations)/edit-destination/page.tsx deleted file mode 100644 index e44b6e4f5..000000000 --- a/frontend/webapp/app/(overview)/(destinations)/edit-destination/page.tsx +++ /dev/null @@ -1,6 +0,0 @@ -'use client'; -import { UpdateDestinationFlow } from '@/containers/main'; - -export default function ManageDestinationPage() { - return ; -} diff --git a/frontend/webapp/app/(overview)/(destinations)/select-destination/page.tsx b/frontend/webapp/app/(overview)/(destinations)/select-destination/page.tsx deleted file mode 100644 index 8c566c757..000000000 --- a/frontend/webapp/app/(overview)/(destinations)/select-destination/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -'use client'; -import { NewDestinationList } from '@/containers/main'; - -export default function CreateDestinationPage() { - return ( -
- -
- ); -} diff --git a/frontend/webapp/app/(overview)/(instrumentation-rules)/choose-rule/page.tsx b/frontend/webapp/app/(overview)/(instrumentation-rules)/choose-rule/page.tsx deleted file mode 100644 index 767de940b..000000000 --- a/frontend/webapp/app/(overview)/(instrumentation-rules)/choose-rule/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { ChooseInstrumentationRuleContainer } from '@/containers'; - -export default function ChooseInstrumentationRulesPage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(instrumentation-rules)/create-rule/page.tsx b/frontend/webapp/app/(overview)/(instrumentation-rules)/create-rule/page.tsx deleted file mode 100644 index 15fa9ae08..000000000 --- a/frontend/webapp/app/(overview)/(instrumentation-rules)/create-rule/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { CreateInstrumentationRulesContainer } from '@/containers'; - -export default function CreateActionPage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(instrumentation-rules)/edit-rule/page.tsx b/frontend/webapp/app/(overview)/(instrumentation-rules)/edit-rule/page.tsx deleted file mode 100644 index 8d6c3a792..000000000 --- a/frontend/webapp/app/(overview)/(instrumentation-rules)/edit-rule/page.tsx +++ /dev/null @@ -1,23 +0,0 @@ -'use client'; -import React from 'react'; -import { useRouter } from 'next/navigation'; -import { OverviewHeader } from '@/components'; -import { EditInstrumentationRuleContainer } from '@/containers'; - -export default function EditInstrumentationRulePage() { - const router = useRouter(); - - function onButtonClick() { - router.back(); - } - - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(instrumentation-rules)/instrumentation-rules/page.tsx b/frontend/webapp/app/(overview)/(instrumentation-rules)/instrumentation-rules/page.tsx deleted file mode 100644 index 30b8d9d5b..000000000 --- a/frontend/webapp/app/(overview)/(instrumentation-rules)/instrumentation-rules/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { OverviewHeader } from '@/components'; -import { ManagedInstrumentationRulesContainer } from '@/containers/main/instrumentation-rules'; - -export default function InstrumentationRulesPage() { - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/(sources)/edit-source/page.tsx b/frontend/webapp/app/(overview)/(sources)/edit-source/page.tsx deleted file mode 100644 index 7d50d4c33..000000000 --- a/frontend/webapp/app/(overview)/(sources)/edit-source/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -'use client'; -import React from 'react'; -import { EditSourceForm } from '@/containers'; - -export default function EditSourcePage() { - return ; -} diff --git a/frontend/webapp/app/(overview)/(sources)/edit-source/styled.tsx b/frontend/webapp/app/(overview)/(sources)/edit-source/styled.tsx deleted file mode 100644 index 8b3c1ae14..000000000 --- a/frontend/webapp/app/(overview)/(sources)/edit-source/styled.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import styled from 'styled-components'; - -export const ManageSourcePageContainer = styled.div` - padding: 32px; -`; - -export const BackButtonWrapper = styled.div` - display: flex; - width: fit-content; - align-items: center; - cursor: pointer; - p { - cursor: pointer !important; - } -`; - -export const FieldWrapper = styled.div` - height: 36px; - width: 348px; - margin-bottom: 64px; -`; - -export const ButtonWrapper = styled.div` - margin-top: 48px; - height: 36px; - width: 362px; -`; diff --git a/frontend/webapp/app/(overview)/(sources)/select-sources/page.tsx b/frontend/webapp/app/(overview)/(sources)/select-sources/page.tsx deleted file mode 100644 index fb8c08c86..000000000 --- a/frontend/webapp/app/(overview)/(sources)/select-sources/page.tsx +++ /dev/null @@ -1,6 +0,0 @@ -'use client'; -import { SelectSourcesContainer } from '@/containers'; - -export default function CreateNewSourcesPage() { - return ; -} diff --git a/frontend/webapp/app/(overview)/(sources)/sources/page.tsx b/frontend/webapp/app/(overview)/(sources)/sources/page.tsx deleted file mode 100644 index 8c1cb92bb..000000000 --- a/frontend/webapp/app/(overview)/(sources)/sources/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -'use client'; -import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { OverviewHeader } from '@/components'; -import { ManagedSourcesContainer } from '@/containers'; - -export default function SourcesPage() { - return ( - <> - - - - ); -} diff --git a/frontend/webapp/app/(overview)/layout.tsx b/frontend/webapp/app/(overview)/layout.tsx index f88ddb65a..c2e7214df 100644 --- a/frontend/webapp/app/(overview)/layout.tsx +++ b/frontend/webapp/app/(overview)/layout.tsx @@ -1,28 +1,32 @@ -import { Menu } from '@/components/side.menu'; -import theme from '@/styles/palette'; -import { METADATA } from '@/utils/constants'; -import { Metadata } from 'next'; +'use client'; import React from 'react'; +import styled from 'styled-components'; +import { MainHeader } from '@/components'; -const LAYOUT_STYLE = { - width: '100%', - height: '100%', - display: 'flex', - backgroundColor: theme.colors.light_dark, -}; +const LayoutContainer = styled.div` + width: 100%; + height: 100vh; + background-color: ${({ theme }) => theme.colors.primary}; + display: flex; + align-items: center; + flex-direction: column; +`; -const CHILDREN_STYLE = { - width: '100%', - height: '93%', -}; +const MainContent = styled.div` + display: flex; + width: 100vw; + height: 76px; + flex-direction: column; + align-items: center; +`; -export const metadata: Metadata = METADATA; - -export default function Layout({ children }: { children: React.ReactNode }) { +export default function MainLayout({ children }: { children: React.ReactNode }) { return ( -
- -
{children}
-
+ + + + {children} + + ); } diff --git a/frontend/webapp/app/(overview)/overview/page.tsx b/frontend/webapp/app/(overview)/overview/page.tsx index 06ba59a7a..678d41714 100644 --- a/frontend/webapp/app/(overview)/overview/page.tsx +++ b/frontend/webapp/app/(overview)/overview/page.tsx @@ -1,14 +1,15 @@ 'use client'; import React from 'react'; -import { OVERVIEW } from '@/utils'; -import { OverviewHeader } from '@/components'; -import { DataFlowContainer } from '@/containers'; +import dynamic from 'next/dynamic'; -export default function OverviewPage() { +const OverviewDataFlowContainer = dynamic(() => import('@/containers/main/overview/overview-data-flow'), { + ssr: false, +}); + +export default function MainPage() { return ( <> - - + ); } diff --git a/frontend/webapp/app/(setup)/choose-destination/page.tsx b/frontend/webapp/app/(setup)/choose-destination/page.tsx index 66b0badb5..07187db2a 100644 --- a/frontend/webapp/app/(setup)/choose-destination/page.tsx +++ b/frontend/webapp/app/(setup)/choose-destination/page.tsx @@ -1,18 +1,16 @@ 'use client'; import React from 'react'; -import { StepsList } from '@/components'; -import { ChooseDestinationContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; +import { SideMenu } from '@/components'; +import { SideMenuWrapper } from '../styled'; +import { ChooseDestinationContainer } from '@/containers/main'; export default function ChooseDestinationPage() { return ( - - - - - - - - + <> + + + + + ); } diff --git a/frontend/webapp/app/(setup)/choose-sources/page.tsx b/frontend/webapp/app/(setup)/choose-sources/page.tsx index 495ec2f21..a612ab2ae 100644 --- a/frontend/webapp/app/(setup)/choose-sources/page.tsx +++ b/frontend/webapp/app/(setup)/choose-sources/page.tsx @@ -1,18 +1,16 @@ 'use client'; import React from 'react'; -import { StepsList } from '@/components'; -import { ChooseSourcesContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; +import { SideMenu } from '@/components'; +import { ChooseSourcesContainer } from '@/containers/main'; +import { SideMenuWrapper } from '../styled'; export default function ChooseSourcesPage() { return ( - - - - - - - - + <> + + + + + ); } diff --git a/frontend/webapp/app/(setup)/connect-destination/page.tsx b/frontend/webapp/app/(setup)/connect-destination/page.tsx deleted file mode 100644 index 5217c328c..000000000 --- a/frontend/webapp/app/(setup)/connect-destination/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client'; -import { StepsList } from '@/components'; -import { ConnectDestinationContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; - -export default function ConnectDestinationPage() { - return ( - - - - - - - - - ); -} diff --git a/frontend/webapp/app/(setup)/layout.tsx b/frontend/webapp/app/(setup)/layout.tsx index d93a42f6f..6e7cab11e 100644 --- a/frontend/webapp/app/(setup)/layout.tsx +++ b/frontend/webapp/app/(setup)/layout.tsx @@ -1,7 +1,23 @@ 'use client'; import React from 'react'; -import Logo from '@/assets/logos/odigos-gradient.svg'; -import { LogoWrapper, SetupPageContainer } from './styled'; +import styled from 'styled-components'; + +const LayoutContainer = styled.div` + width: 100%; + height: 100vh; + background-color: ${({ theme }) => theme.colors.primary}; + display: flex; + align-items: center; + flex-direction: column; +`; + +const MainContent = styled.div` + display: flex; + max-width: 1440px; + width: 100vh; + flex-direction: column; + align-items: center; +`; export default function SetupLayout({ children, @@ -9,11 +25,8 @@ export default function SetupLayout({ children: React.ReactNode; }) { return ( - - - - - {children} - + + {children} + ); } diff --git a/frontend/webapp/app/(setup)/styled.ts b/frontend/webapp/app/(setup)/styled.ts new file mode 100644 index 000000000..a4d810aa6 --- /dev/null +++ b/frontend/webapp/app/(setup)/styled.ts @@ -0,0 +1,11 @@ +import styled from 'styled-components'; + +export const SideMenuWrapper = styled.div` + position: absolute; + left: 24px; + top: 144px; + + @media (max-width: 1050px) { + display: none; + } +`; diff --git a/frontend/webapp/app/(setup)/styled.tsx b/frontend/webapp/app/(setup)/styled.tsx deleted file mode 100644 index 4e3e49040..000000000 --- a/frontend/webapp/app/(setup)/styled.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import styled from 'styled-components'; - -export const SetupPageContainer = styled.div` - width: 100vw; - height: 100vh; - - background: var( - --gradient-dark, - radial-gradient( - 44.09% 58.18% at 100% -14%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), - linear-gradient(181deg, #091824 0%, #2b2f56 100%) - ); - display: flex; - flex-direction: column; - align-items: center; -`; - -export const LogoWrapper = styled.div` - position: absolute; - top: 20px; - left: 20px; -`; - -export const StepListWrapper = styled.div` - height: 5%; - padding: 32px; - width: 100%; - display: inline-flex; - justify-content: center; -`; - -export const PageContainer = styled.div` - height: 100vh; -`; - -export const CardWrapper = styled.div` - height: 85%; -`; diff --git a/frontend/webapp/app/globals.css b/frontend/webapp/app/globals.css new file mode 100644 index 000000000..6bbdf7e7c --- /dev/null +++ b/frontend/webapp/app/globals.css @@ -0,0 +1,4 @@ +/* Preload key fonts in your global CSS */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap'); diff --git a/frontend/webapp/app/layout.tsx b/frontend/webapp/app/layout.tsx index 2387fee82..3dfbd5a34 100644 --- a/frontend/webapp/app/layout.tsx +++ b/frontend/webapp/app/layout.tsx @@ -1,12 +1,10 @@ 'use client'; +import './globals.css'; import React from 'react'; import { useSSE } from '@/hooks'; -import theme from '@/styles/palette'; -import { ThemeProvider } from 'styled-components'; -import { NotificationManager } from '@/components'; -import ReduxProvider from '@/store/redux-provider'; -import { QueryClient, QueryClientProvider } from 'react-query'; -import { ThemeProviderWrapper } from '@keyval-dev/design-system'; +import { METADATA } from '@/utils'; +import { ApolloWrapper } from '@/lib'; +import { ThemeProviderWrapper } from '@/styles'; const LAYOUT_STYLE: React.CSSProperties = { margin: 0, @@ -14,39 +12,30 @@ const LAYOUT_STYLE: React.CSSProperties = { scrollbarWidth: 'none', width: '100vw', height: '100vh', - backgroundColor: theme.colors.dark, }; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - const queryClient = new QueryClient({ - defaultOptions: { - queries: { - staleTime: 10000, - refetchOnWindowFocus: false, - }, - }, - }); - +export default function RootLayout({ children }: { children: React.ReactNode }) { useSSE(); return ( - - - - - - - {children} - - - - - - + + + {METADATA.title} + + + + + + + + + + + + {children} + + + ); } diff --git a/frontend/webapp/app/page.tsx b/frontend/webapp/app/page.tsx index bb5248607..cc0cd3989 100644 --- a/frontend/webapp/app/page.tsx +++ b/frontend/webapp/app/page.tsx @@ -1,60 +1,35 @@ 'use client'; import { useEffect } from 'react'; -import { useQuery } from 'react-query'; import { useRouter } from 'next/navigation'; -import { ROUTES, CONFIG, QUERIES } from '@/utils'; -import { Loader } from '@keyval-dev/design-system'; -import { getDestinations, getConfig } from '@/services'; -import { addNotification, store } from '@/store'; +import { useNotify, useConfig } from '@/hooks'; +import { FadeLoader } from '@/reuseable-components'; +import { ROUTES, CONFIG, NOTIFICATION } from '@/utils'; + export default function App() { const router = useRouter(); - const { data, isLoading: isConfigLoading } = useQuery( - [QUERIES.API_CONFIG], - getConfig - ); - const { - isLoading: isDestinationLoading, - data: destinationList, - error, - } = useQuery([QUERIES.API_DESTINATIONS], getDestinations); - useEffect(() => { - if (isConfigLoading || isDestinationLoading) return; - - renderCurrentPage(); - }, [data, destinationList]); + const notify = useNotify(); + const { data, error } = useConfig(); useEffect(() => { - if (!error) return; - store.dispatch( - addNotification({ - id: '1', - message: 'An error occurred', - title: 'Error', - type: 'error', - target: 'notification', - crdType: 'notification', - }) - ); - router.push(ROUTES.OVERVIEW); - }, [error]); - - function renderCurrentPage() { - const { installation } = data; - - if (destinationList.length > 0) { - router.push(ROUTES.OVERVIEW); - return; - } + if (error) { + notify({ + type: NOTIFICATION.ERROR, + title: error.name, + message: error.message, + }); + } else if (data) { + const { installation } = data; - switch (installation) { - case CONFIG.NEW: - case CONFIG.APPS_SELECTED: - router.push(ROUTES.CHOOSE_SOURCES); - break; - case CONFIG.FINISHED: - router.push(ROUTES.OVERVIEW); + switch (installation) { + case CONFIG.NEW: + case CONFIG.APPS_SELECTED: + router.push(ROUTES.CHOOSE_SOURCES); + break; + case CONFIG.FINISHED: + router.push(ROUTES.OVERVIEW); + } } - } + }, [data]); - return ; + return ; } diff --git a/frontend/webapp/components/common/card-details/index.tsx b/frontend/webapp/components/common/card-details/index.tsx new file mode 100644 index 000000000..e7654b42d --- /dev/null +++ b/frontend/webapp/components/common/card-details/index.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import styled from 'styled-components'; +import { ConfiguredFields } from '@/components'; +import { Text } from '@/reuseable-components'; +interface CardDetailsProps { + title?: string; + data: { + title: string; + tooltip?: string; + value: string; + }[]; +} + +const CardDetails: React.FC = ({ data, title = 'Details' }) => { + return ( + + + {title} + + + + ); +}; + +export { CardDetails }; + +const Container = styled.div` + display: flex; + flex-direction: column; + padding: 16px 24px 24px 24px; + flex-direction: column; + align-items: flex-start; + gap: 16px; + align-self: stretch; + border-radius: 24px; + border: 1px solid ${({ theme }) => theme.colors.border}; +`; + +const TitleWrapper = styled.div``; diff --git a/frontend/webapp/components/common/conditions.check.tsx b/frontend/webapp/components/common/conditions.check.tsx deleted file mode 100644 index 4a660423a..000000000 --- a/frontend/webapp/components/common/conditions.check.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from 'react'; -import { GreenCheckIcon, RedErrorIcon } from '@keyval-dev/design-system'; -import styled from 'styled-components'; -import { KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; - -const Container = styled.div` - display: inline-block; - position: relative; -`; - -const StatusIcon = styled.div` - font-size: 24px; - cursor: pointer; -`; -const ProgressStatus = styled.div` - width: 6px; - height: 6px; - border-radius: 50%; - background-color: ${theme.colors.orange_brown}; -`; - -const Tooltip = styled.div` - visibility: hidden; - width: max-content; - background-color: black; - color: #fff; - text-align: center; - border-radius: 5px; - padding: 8px; - position: absolute; - z-index: 1; - bottom: 100%; /* Position above the icon */ - left: 50%; - transform: translateX(-50%); - opacity: 0; - transition: opacity 0.3s; - - ${Container}:hover & { - visibility: visible; - opacity: 1; - } -`; - -export const ConditionCheck = ({ conditions }) => { - const healthyCount = conditions?.filter( - (condition) => condition.status === 'True' - ).length; - const totalCount = conditions?.length; - const allHealthy = healthyCount === totalCount; - - return conditions ? ( - - - {allHealthy ? : } - - - {`${healthyCount}/${totalCount} checks OK`} - - - ) : ( - - - - {'validating checks...'} - - - ); -}; diff --git a/frontend/webapp/components/common/configured-fields/index.tsx b/frontend/webapp/components/common/configured-fields/index.tsx new file mode 100644 index 000000000..97df981b2 --- /dev/null +++ b/frontend/webapp/components/common/configured-fields/index.tsx @@ -0,0 +1,95 @@ +import React, { Fragment } from 'react'; +import styled from 'styled-components'; +import { Text, Status, Tooltip } from '@/reuseable-components'; +import Image from 'next/image'; + +type TypeDetail = { + title: string; + tooltip?: string; + value: string; +}; + +type ConfiguredFieldsProps = { + details: TypeDetail[]; +}; + +const ListContainer = styled.div` + display: flex; + flex-wrap: wrap; + gap: 24px 40px; +`; + +const ListItem = styled.div``; + +const ItemTitle = styled(Text)` + color: #b8b8b8; + font-size: 10px; + line-height: 16px; +`; + +const ItemValue = styled(Text)` + color: ${({ theme }) => theme.colors.text}; + font-size: 12px; + line-height: 18px; +`; + +export const ConfiguredFields: React.FC = ({ details }) => { + const parseValue = (value: string) => { + let str = ''; + + try { + const parsed = JSON.parse(value); + + // Handle arrays + if (Array.isArray(parsed)) { + str = parsed + .map((item) => { + if (typeof item === 'object' && item !== null) { + return `${item.key}: ${item.value}`; + } + + return item; + }) + .join(', '); + } + + // Handle objects (non-array JSON objects) + else if (typeof parsed === 'object' && parsed !== null) { + str = Object.entries(parsed) + .map(([key, val]) => `${key}: ${val}`) + .join(', '); + } + + // Should never reach this if it's a string (it will throw) + else { + str = value; + } + } catch (error) { + str = value; + } + + const strSplitted = str.split('\n'); + + return strSplitted.map((str, idx) => ( + + {str} + {idx < strSplitted.length - 1 ?
: null} +
+ )); + }; + + return ( + + {details.map((detail, index) => ( + + + {detail.title} + {detail.tooltip && Info} + + + {detail.title === 'Status' ? : {parseValue(detail.value)}} + + ))} + + ); +}; diff --git a/frontend/webapp/components/common/dropdowns/error-dropdown/index.tsx b/frontend/webapp/components/common/dropdowns/error-dropdown/index.tsx new file mode 100644 index 000000000..30410af3a --- /dev/null +++ b/frontend/webapp/components/common/dropdowns/error-dropdown/index.tsx @@ -0,0 +1,34 @@ +import React, { useMemo } from 'react'; +import { useSourceCRUD } from '@/hooks'; +import { DropdownOption } from '@/types'; +import { Dropdown } from '@/reuseable-components'; + +interface Props { + title?: string; + value?: DropdownOption[]; + onSelect: (val: DropdownOption) => void; + onDeselect: (val: DropdownOption) => void; + isMulti?: boolean; + required?: boolean; + showSearch?: boolean; +} + +export const ErrorDropdown: React.FC = ({ title = 'Error Message', value, onSelect, onDeselect, ...props }) => { + const { sources } = useSourceCRUD(); + + const options = useMemo(() => { + const payload: DropdownOption[] = []; + + sources.forEach(({ instrumentedApplicationDetails: { conditions } }) => { + conditions.forEach(({ type, status, message }) => { + if (status === 'False' && !payload.find((opt) => opt.value === message)) { + payload.push({ id: message, value: message }); + } + }); + }); + + return payload; + }, [sources]); + + return ; +}; diff --git a/frontend/webapp/components/common/dropdowns/index.ts b/frontend/webapp/components/common/dropdowns/index.ts new file mode 100644 index 000000000..096f148b8 --- /dev/null +++ b/frontend/webapp/components/common/dropdowns/index.ts @@ -0,0 +1,4 @@ +export * from './error-dropdown'; +export * from './monitor-dropdown'; +export * from './namespace-dropdown'; +export * from './type-dropdown'; diff --git a/frontend/webapp/components/common/dropdowns/monitor-dropdown/index.tsx b/frontend/webapp/components/common/dropdowns/monitor-dropdown/index.tsx new file mode 100644 index 000000000..47fedc97b --- /dev/null +++ b/frontend/webapp/components/common/dropdowns/monitor-dropdown/index.tsx @@ -0,0 +1,30 @@ +import React, { useMemo } from 'react'; +import { MONITORS_OPTIONS } from '@/utils'; +import type { DropdownOption } from '@/types'; +import { Dropdown } from '@/reuseable-components'; + +interface Props { + title?: string; + value?: DropdownOption[]; + onSelect: (val: DropdownOption) => void; + onDeselect: (val: DropdownOption) => void; + isMulti?: boolean; + required?: boolean; + showSearch?: boolean; +} + +export const MonitorDropdown: React.FC = ({ title = 'Monitors', value, onSelect, onDeselect, ...props }) => { + const options = useMemo(() => { + const payload: DropdownOption[] = []; + + MONITORS_OPTIONS.forEach(({ id, value }) => { + if (!payload.find((opt) => opt.id === id)) { + payload.push({ id, value }); + } + }); + + return payload; + }, []); + + return ; +}; diff --git a/frontend/webapp/components/common/dropdowns/namespace-dropdown/index.tsx b/frontend/webapp/components/common/dropdowns/namespace-dropdown/index.tsx new file mode 100644 index 000000000..7bf03c56b --- /dev/null +++ b/frontend/webapp/components/common/dropdowns/namespace-dropdown/index.tsx @@ -0,0 +1,32 @@ +import React, { useMemo } from 'react'; +import { useNamespace } from '@/hooks'; +import type { DropdownOption } from '@/types'; +import { Dropdown } from '@/reuseable-components'; + +interface Props { + title?: string; + value?: DropdownOption; + onSelect: (val: DropdownOption) => void; + onDeselect: (val: DropdownOption) => void; + isMulti?: boolean; + required?: boolean; + showSearch?: boolean; +} + +export const NamespaceDropdown: React.FC = ({ title = 'Namespace', value, onSelect, onDeselect, ...props }) => { + const { allNamespaces } = useNamespace(); + + const options = useMemo(() => { + const payload: DropdownOption[] = []; + + allNamespaces?.forEach(({ name: id }) => { + if (!payload.find((opt) => opt.id === id)) { + payload.push({ id, value: id }); + } + }); + + return payload; + }, [allNamespaces]); + + return ; +}; diff --git a/frontend/webapp/components/common/dropdowns/type-dropdown/index.tsx b/frontend/webapp/components/common/dropdowns/type-dropdown/index.tsx new file mode 100644 index 000000000..b518fca49 --- /dev/null +++ b/frontend/webapp/components/common/dropdowns/type-dropdown/index.tsx @@ -0,0 +1,32 @@ +import React, { useMemo } from 'react'; +import { useSourceCRUD } from '@/hooks'; +import type { DropdownOption } from '@/types'; +import { Dropdown } from '@/reuseable-components'; + +interface Props { + title?: string; + value?: DropdownOption[]; + onSelect: (val: DropdownOption) => void; + onDeselect: (val: DropdownOption) => void; + isMulti?: boolean; + required?: boolean; + showSearch?: boolean; +} + +export const TypeDropdown: React.FC = ({ title = 'Type', value, onSelect, onDeselect, ...props }) => { + const { sources } = useSourceCRUD(); + + const options = useMemo(() => { + const payload: DropdownOption[] = []; + + sources.forEach(({ kind: id }) => { + if (!payload.find((opt) => opt.id === id)) { + payload.push({ id, value: id }); + } + }); + + return payload; + }, [sources]); + + return ; +}; diff --git a/frontend/webapp/components/common/index.ts b/frontend/webapp/components/common/index.ts index d60373d11..a9076a4d9 100644 --- a/frontend/webapp/components/common/index.ts +++ b/frontend/webapp/components/common/index.ts @@ -1,2 +1,3 @@ -export * from './multi.checkbox'; -export * from './conditions.check'; +export * from './card-details'; +export * from './configured-fields'; +export * from './dropdowns'; diff --git a/frontend/webapp/components/common/multi.checkbox.tsx b/frontend/webapp/components/common/multi.checkbox.tsx deleted file mode 100644 index d341734c7..000000000 --- a/frontend/webapp/components/common/multi.checkbox.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { KeyvalCheckbox, KeyvalText } from '@/design.system'; -import React, { use, useEffect, useState } from 'react'; -import styled from 'styled-components'; - -interface CheckboxItem { - id: string; - label: string; - checked: boolean; -} - -interface MultiCheckboxProps { - title?: string; - checkboxes: CheckboxItem[]; - onSelectionChange: (selectedCheckboxes: CheckboxItem[]) => void; -} - -const CheckboxWrapper = styled.div` - display: flex; - gap: 14px; -`; - -export const MultiCheckboxComponent: React.FC = ({ - title, - checkboxes, - onSelectionChange, -}) => { - const [isCheckboxDisabled, setIsCheckboxDisabled] = useState(false); - const [selectedMonitors, setSelectedMonitors] = - useState(checkboxes); - - useEffect(() => { - checkboxes.length === 1 && setIsCheckboxDisabled(true); - }, [checkboxes]); - - const handleCheckboxChange = (id: string) => { - // Calculate the number of currently checked checkboxes - const currentlyCheckedCount = selectedMonitors.filter( - (checkbox) => checkbox.checked - ).length; - - // Update logic to ensure at least one checkbox remains checked - const updatedSelection = selectedMonitors.map((checkbox) => { - if (checkbox.id === id) { - // Prevent unchecking if this is the last checked checkbox - if (checkbox.checked && currentlyCheckedCount === 1) { - return checkbox; // Do not change the state if attempting to uncheck the last checked checkbox - } - - return { ...checkbox, checked: !checkbox.checked }; - } - return checkbox; - }); - - setSelectedMonitors(updatedSelection); - onSelectionChange(updatedSelection); - - const newCheckedCount = updatedSelection.filter( - (checkbox) => checkbox.checked - ).length; - setIsCheckboxDisabled(newCheckedCount <= 1); - }; - - return ( - <> - {title && ( - - {title} - - )} - - {selectedMonitors.map((checkbox) => ( - handleCheckboxChange(checkbox?.id)} - label={checkbox?.label} - /> - ))} - - - ); -}; diff --git a/frontend/webapp/components/destinations/add-destination-button/index.tsx b/frontend/webapp/components/destinations/add-destination-button/index.tsx new file mode 100644 index 000000000..281d403c7 --- /dev/null +++ b/frontend/webapp/components/destinations/add-destination-button/index.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import Image from 'next/image'; +import theme from '@/styles/theme'; +import styled from 'styled-components'; +import { Button, Text } from '@/reuseable-components'; + +const StyledAddDestinationButton = styled(Button)` + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + width: 100%; +`; + +interface ModalActionComponentProps { + onClick: () => void; +} + +export function AddDestinationButton({ onClick }: ModalActionComponentProps) { + return ( + + back + + ADD DESTINATION + + + ); +} diff --git a/frontend/webapp/components/destinations/edit-destination-form/index.tsx b/frontend/webapp/components/destinations/edit-destination-form/index.tsx new file mode 100644 index 000000000..674de1f67 --- /dev/null +++ b/frontend/webapp/components/destinations/edit-destination-form/index.tsx @@ -0,0 +1,35 @@ +import React from 'react'; +import styled from 'styled-components'; +import { CheckboxList } from '@/reuseable-components'; +import type { DynamicField, ExportedSignals, SupportedDestinationSignals } from '@/types'; +import { DynamicConnectDestinationFormFields } from '@/containers/main/destinations/add-destination/dynamic-form-fields'; + +interface DestinationFormProps { + exportedSignals: ExportedSignals; + supportedSignals: SupportedDestinationSignals; + dynamicFields: DynamicField[]; + handleDynamicFieldChange: (name: string, value: any) => void; + handleSignalChange: (signal: keyof ExportedSignals, value: boolean) => void; +} + +const Container = styled.div` + display: flex; + flex-direction: column; + gap: 24px; + padding: 4px; +`; + +export const EditDestinationForm: React.FC = ({ exportedSignals, supportedSignals, dynamicFields, handleSignalChange, handleDynamicFieldChange }) => { + const monitors = [ + supportedSignals.logs.supported && { id: 'logs', title: 'Logs' }, + supportedSignals.metrics.supported && { id: 'metrics', title: 'Metrics' }, + supportedSignals.traces.supported && { id: 'traces', title: 'Traces' }, + ].filter(Boolean); + + return ( + + + + + ); +}; diff --git a/frontend/webapp/components/destinations/index.ts b/frontend/webapp/components/destinations/index.ts new file mode 100644 index 000000000..e852a65cc --- /dev/null +++ b/frontend/webapp/components/destinations/index.ts @@ -0,0 +1,3 @@ +export * from './add-destination-button'; +export * from './monitors-tap-list'; +export * from './edit-destination-form'; diff --git a/frontend/webapp/components/destinations/monitors-tap-list/index.tsx b/frontend/webapp/components/destinations/monitors-tap-list/index.tsx new file mode 100644 index 000000000..fbc4685b4 --- /dev/null +++ b/frontend/webapp/components/destinations/monitors-tap-list/index.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Text, Tag } from '@/reuseable-components'; +import { MONITORS_OPTIONS } from '@/utils'; +import Image from 'next/image'; + +interface MonitorButtonsProps { + selectedMonitors: string[]; + onMonitorSelect: (monitor: string) => void; +} + +const MonitorButtonsContainer = styled.div` + display: flex; + gap: 8px; + margin-left: 12px; +`; + +const MonitorsTitle = styled(Text)` + opacity: 0.8; + font-size: 14px; + margin-left: 32px; +`; + +const MonitorsTapList: React.FC = ({ + selectedMonitors, + onMonitorSelect, +}) => { + return ( + <> + Monitor by: + + {MONITORS_OPTIONS.map((monitor) => ( + onMonitorSelect(monitor.id)} + > + monitor + {monitor.value} + + ))} + + + ); +}; + +export { MonitorsTapList }; diff --git a/frontend/webapp/components/index.ts b/frontend/webapp/components/index.ts index c03b571ed..aa76f1ec5 100644 --- a/frontend/webapp/components/index.ts +++ b/frontend/webapp/components/index.ts @@ -1,6 +1,7 @@ export * from './setup'; -export * from './lists'; export * from './overview'; export * from './common'; -export * from './notification/notification-manager'; -export * from './notification/notification-list'; +export * from './destinations'; +export * from './main'; +export * from './modals'; +export * from './notification'; diff --git a/frontend/webapp/components/lists/empty.list/empty.list.tsx b/frontend/webapp/components/lists/empty.list/empty.list.tsx deleted file mode 100644 index 27af29d83..000000000 --- a/frontend/webapp/components/lists/empty.list/empty.list.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { Empty } from '@/assets/images'; -import { PlusIcon } from '@keyval-dev/design-system'; -import { KeyvalButton, KeyvalText } from '@/design.system'; - -interface EmptyListProps { - title?: string; - btnTitle?: string; - btnAction?: () => void; -} - -const EmptyListWrapper = styled.div` - width: 100%; - margin-top: 130px; - display: flex; - gap: 6px; - flex-direction: column; - justify-content: center; - align-items: center; -`; -const BUTTON_STYLES = { gap: 10, height: 40 }; -export function EmptyList({ title, btnTitle, btnAction }: EmptyListProps) { - return ( - - - {title && ( - <> - {title} - - )} - {btnAction && ( - - - - {btnTitle} - - - )} - - ); -} diff --git a/frontend/webapp/components/lists/index.tsx b/frontend/webapp/components/lists/index.tsx deleted file mode 100644 index 59201b3e7..000000000 --- a/frontend/webapp/components/lists/index.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export { EmptyList } from './empty.list/empty.list'; -export * from './step-list'; -export * from './instrumentation-config-list'; diff --git a/frontend/webapp/components/lists/instrumentation-config-list/index.tsx b/frontend/webapp/components/lists/instrumentation-config-list/index.tsx deleted file mode 100644 index 6e248c86f..000000000 --- a/frontend/webapp/components/lists/instrumentation-config-list/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; - -import { KeyvalText } from '@/design.system'; -import { InstrumentationConfig } from '@/types'; -import { TextInformationWrapper } from './style.styled'; -import InstrumentationConfigListItem from './instrumentation-config-list-item'; - -const SOURCES = { - INSTRUMENTATION_CONFIG_LIBRARIES: 'Data Collection Settings', - INSTRUMENTATION_CONFIG_INFO: - 'Boost your trace data with precision. Every selection from these libraries contributes essential details to the data sent to the chosen destinations, empowering you with richer insights.', -}; - -interface InstrumentationConfigListProps { - list: InstrumentationConfig[] | undefined; - onChange: (list: InstrumentationConfig[]) => void; -} - -export function InstrumentationConfigList({ - list, - onChange, -}: InstrumentationConfigListProps) { - function onOptionChange(option: InstrumentationConfig) { - const newConfig = list?.map((item: InstrumentationConfig) => { - if ( - item.optionKey === option.optionKey && - item.spanKind === option.spanKind - ) { - return { - ...option, - }; - } - return item; - }); - - onChange(newConfig || []); - } - - return ( -
- - - {SOURCES.INSTRUMENTATION_CONFIG_LIBRARIES} - - - {SOURCES.INSTRUMENTATION_CONFIG_INFO} - - - {list?.map((item: InstrumentationConfig, index: number) => ( -
- -
- ))} -
- ); -} diff --git a/frontend/webapp/components/lists/instrumentation-config-list/instrumentation-config-list-item.tsx b/frontend/webapp/components/lists/instrumentation-config-list/instrumentation-config-list-item.tsx deleted file mode 100644 index fc1377509..000000000 --- a/frontend/webapp/components/lists/instrumentation-config-list/instrumentation-config-list-item.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import React, { useState } from 'react'; - -import { - HeaderItemWrapper, - InstrumentationConfigHeaderContent, - InstrumentationConfigItemContainer, - InstrumentationConfigItemContent, - InstrumentationConfigItemHeader, - StyledItemCountContainer, -} from './style.styled'; -import { KeyvalCheckbox, KeyvalTag, KeyvalText } from '@/design.system'; -import InstrumentedLibraryOption from './library-option'; -import { InstrumentationConfig, InstrumentationConfigLibrary } from '@/types'; -import theme from '@/styles/palette'; -import { ExpandIcon } from '@keyval-dev/design-system'; -const InstrumentationConfigListItem = ({ - item, - onOptionChange, -}: { - children?: JSX.Element; - item: InstrumentationConfig; - onOptionChange: (item: any) => void; -}) => { - const [isOpen, setIsOpen] = useState(false); - - const toggleLibOptions = () => { - setIsOpen(!isOpen); - }; - - function renderOptions() { - return item.instrumentationLibraries.map( - (lib: InstrumentationConfigLibrary) => ( - onLibChange(lib.instrumentationLibraryName)} - disabled={false} - /> - ) - ); - } - - function onOptionKeyChange() { - const newLibraries = item.instrumentationLibraries.map((lib) => ({ - ...lib, - selected: !item.optionValueBoolean, - })); - onOptionChange({ - ...item, - optionValueBoolean: !item.optionValueBoolean, - instrumentationLibraries: newLibraries, - }); - } - - function onLibChange(name: string) { - const instrumentationLibraries = item.instrumentationLibraries.map((lib) => - lib.instrumentationLibraryName === name - ? { ...lib, selected: !lib.selected } - : lib - ); - - const optionValueBoolean = instrumentationLibraries.some( - (lib) => lib.selected - ); - - onOptionChange({ - ...item, - optionValueBoolean, - instrumentationLibraries, - }); - } - - function getSelectedLibrariesCount() { - return item.instrumentationLibraries?.filter( - (lib: InstrumentationConfigLibrary) => lib.selected - ).length; - } - - function renderHeader() { - return ( - - - - -
- - - {item.optionKey} - - - - -
- - - {`${getSelectedLibrariesCount()}/${ - item.instrumentationLibraries?.length - } libraries`} - - - - -
-
- ); - } - - return ( - - {renderHeader()} - - {renderOptions()} - - - ); -}; - -export default InstrumentationConfigListItem; diff --git a/frontend/webapp/components/lists/instrumentation-config-list/library-option.tsx b/frontend/webapp/components/lists/instrumentation-config-list/library-option.tsx deleted file mode 100644 index 40a158d61..000000000 --- a/frontend/webapp/components/lists/instrumentation-config-list/library-option.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { - LibCheckboxWrapper, - LibNameWrapper, - StyledLibraryOptionContainer, -} from './style.styled'; - -import { KeyvalCheckbox, KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; - -const SOURCES = { - LANGUAGE: 'Language', - LIBRARY: 'Library', -}; - -export default function InstrumentedLibraryOption({ - name, - selected, - onChange, - disabled = false, -}: { - name: string; - selected: boolean; - onChange: (name: string) => void; - disabled: boolean; -}) { - return ( - - - onChange(name)} - disabled={disabled} - /> - - - - {SOURCES.LIBRARY} - - - {name} - - - - ); -} diff --git a/frontend/webapp/components/lists/instrumentation-config-list/style.styled.ts b/frontend/webapp/components/lists/instrumentation-config-list/style.styled.ts deleted file mode 100644 index bbd579be7..000000000 --- a/frontend/webapp/components/lists/instrumentation-config-list/style.styled.ts +++ /dev/null @@ -1,84 +0,0 @@ -import styled from 'styled-components'; - -export const InstrumentationConfigItemContainer = styled.div` - border-radius: 8px; -`; - -export const InstrumentationConfigItemHeader = styled.div` - display: flex; - margin: 12px 0; - cursor: pointer; - span { - width: 18px !important; - height: 18px !important; - } - .dropdown-arrow { - transform: rotate(0deg); - transition: all 0.2s ease-in-out; - } - - .dropdown-arrow.open { - transform: rotate(180deg); - } -`; - -export const InstrumentationConfigItemContent = styled.div<{ open: boolean }>` - display: ${({ open }) => (open ? 'flex' : 'none')}; - flex-direction: column; - gap: 12px; - padding: 0px 12px 12px 34px; - border-bottom: 1px solid #e5e7eb1a; -`; - -export const StyledItemCountContainer = styled.div` - display: flex; - justify-content: center; - align-items: center; - padding: 0 8px; - border-radius: 16px; - height: 32px; -`; - -export const StyledLibraryOptionContainer = styled.div` - width: fit-content; - display: flex; - gap: 8px; - - span { - width: 18px !important; - height: 18px !important; - } -`; - -export const InstrumentationConfigHeaderContent = styled.div` - display: flex; - margin-left: 8px; - width: 100%; - justify-content: space-between; - align-items: center; -`; - -export const HeaderItemWrapper = styled.div` - display: flex; - align-items: center; - gap: 8px; -`; - -export const TextInformationWrapper = styled.div` - display: flex; - flex-direction: column; - gap: 8px; -`; - -export const LibCheckboxWrapper = styled.div<{ disabled: boolean }>` - display: flex; - align-items: center; - cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; -`; - -export const LibNameWrapper = styled.div` - width: 200px; - display: flex; - flex-direction: column; - gap: 2px; -`; diff --git a/frontend/webapp/components/lists/step-list/index.tsx b/frontend/webapp/components/lists/step-list/index.tsx deleted file mode 100644 index 4decf75ff..000000000 --- a/frontend/webapp/components/lists/step-list/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -'use client'; -import React from 'react'; -import { Steps } from '@/design.system'; - -const STEP_STATUS = { - ACTIVE: 'active', - DISABLED: 'disabled', - DONE: 'done', -}; - -const SETUP_STEPS = [ - { - title: 'Choose Source', - index: 0, - status: 'disabled', - id: 'choose-source', - }, - { - title: 'Choose Destination', - index: 1, - status: 'disabled', - id: 'choose-destination', - }, - { - title: 'Create Connection', - index: 2, - status: 'disabled', - id: 'create-connection', - }, -]; - -type Step = { - index: number; - title: string; - status: string; - id: string; - subtitle?: string; -}; - -interface SetupStepsProps { - currentStepIndex: number; -} - -export function StepsList({ currentStepIndex }: SetupStepsProps) { - function buildSteps() { - return SETUP_STEPS.map((step: Step) => { - return { - ...step, - status: - step.index === currentStepIndex - ? STEP_STATUS.ACTIVE - : step.index < currentStepIndex - ? STEP_STATUS.DONE - : STEP_STATUS.DISABLED, - }; - }); - } - - return ; -} diff --git a/frontend/webapp/components/main/header/cp-title/index.tsx b/frontend/webapp/components/main/header/cp-title/index.tsx new file mode 100644 index 000000000..c7bf856d2 --- /dev/null +++ b/frontend/webapp/components/main/header/cp-title/index.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { Text } from '@/reuseable-components'; + +interface PlatformProps { + type: 'k8s' | 'vm'; +} + +const PlatformWrapper = styled.div` + display: flex; + align-items: center; + padding: 10px; +`; + +const IconWrapper = styled.div` + margin-right: 10px; +`; + +const TextWrapper = styled.div` + display: flex; + align-items: center; +`; + +const Title = styled(Text)` + font-size: 14px; + margin-right: 10px; + color: ${({ theme }) => theme.colors.white}; +`; + +const PlatformTitle: React.FC = ({ type }) => { + return ( + + + {type} + + + + {type === 'k8s' ? 'Kubernetes Cluster' : 'Virtual Machine'} + + + + ); +}; + +export { PlatformTitle }; diff --git a/frontend/webapp/components/main/header/index.tsx b/frontend/webapp/components/main/header/index.tsx new file mode 100644 index 000000000..345ca679b --- /dev/null +++ b/frontend/webapp/components/main/header/index.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { PlatformTitle } from './cp-title'; +import { useConnectionStore } from '@/store'; +import { Status } from '@/reuseable-components'; +import { NotificationManager } from '@/components/notification'; + +interface MainHeaderProps {} + +const Flex = styled.div` + display: flex; + align-items: center; +`; + +const HeaderContainer = styled(Flex)` + width: 100%; + padding: 12px 0; + background-color: ${({ theme }) => theme.colors.dark_grey}; + border-bottom: 1px solid rgba(249, 249, 249, 0.16); +`; + +const AlignLeft = styled(Flex)` + margin-right: auto; + margin-left: 32px; + gap: 16px; +`; + +const AlignRight = styled(Flex)` + margin-left: auto; + margin-right: 32px; + gap: 16px; +`; + +export const MainHeader: React.FC = () => { + const { connecting, active, title, message } = useConnectionStore(); + + return ( + + + logo + + {!connecting && } + + + + + + + ); +}; diff --git a/frontend/webapp/components/main/index.tsx b/frontend/webapp/components/main/index.tsx new file mode 100644 index 000000000..677ca79d4 --- /dev/null +++ b/frontend/webapp/components/main/index.tsx @@ -0,0 +1 @@ +export * from './header'; diff --git a/frontend/webapp/components/modals/cancel-warning/index.tsx b/frontend/webapp/components/modals/cancel-warning/index.tsx new file mode 100644 index 000000000..a59ea05e1 --- /dev/null +++ b/frontend/webapp/components/modals/cancel-warning/index.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { WarningModal } from '@/reuseable-components'; + +interface Props { + isOpen: boolean; + noOverlay?: boolean; + name?: string; + onApprove: () => void; + onDeny: () => void; +} + +const CancelWarning: React.FC = ({ isOpen, noOverlay, name, onApprove, onDeny }) => { + return ( + + ); +}; + +export { CancelWarning }; diff --git a/frontend/webapp/components/modals/delete-warning/index.tsx b/frontend/webapp/components/modals/delete-warning/index.tsx new file mode 100644 index 000000000..a95c1bb0b --- /dev/null +++ b/frontend/webapp/components/modals/delete-warning/index.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import { WarningModal } from '@/reuseable-components'; +import { NotificationType } from '@/types'; + +interface Props { + isOpen: boolean; + noOverlay?: boolean; + name?: string; + note?: { + type: NotificationType; + title: string; + message: string; + }; + onApprove: () => void; + onDeny: () => void; +} + +const DeleteWarning: React.FC = ({ isOpen, noOverlay, name, note, onApprove, onDeny }) => { + return ( + + ); +}; + +export { DeleteWarning }; diff --git a/frontend/webapp/components/modals/index.ts b/frontend/webapp/components/modals/index.ts new file mode 100644 index 000000000..96e4964db --- /dev/null +++ b/frontend/webapp/components/modals/index.ts @@ -0,0 +1,2 @@ +export * from './cancel-warning'; +export * from './delete-warning'; diff --git a/frontend/webapp/components/notification/index.tsx b/frontend/webapp/components/notification/index.tsx new file mode 100644 index 000000000..fe2628507 --- /dev/null +++ b/frontend/webapp/components/notification/index.tsx @@ -0,0 +1,2 @@ +export * from './notification-manager'; +export * from './toast-list'; diff --git a/frontend/webapp/components/notification/notification-container.tsx b/frontend/webapp/components/notification/notification-container.tsx deleted file mode 100644 index 5b6ed9024..000000000 --- a/frontend/webapp/components/notification/notification-container.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import styled, { keyframes } from 'styled-components'; -import theme from '@/styles/palette'; - -interface NotificationContainerProps { - children: React.ReactNode; - type?: string; - isLeaving?: boolean; - seen?: boolean; -} - -const slideIn = keyframes` - from { - transform: translateX(100%); - } - to { - transform: translateX(0); - } -`; - -const slideOut = keyframes` - from { - transform: translateX(0); - } - to { - transform: translateX(100%); - } -`; - -const StyledNotificationContainer = styled.div` - border: 1px solid ${theme.colors.blue_grey}; - background-color: ${theme.colors.dark}; - border-radius: 8px; - padding: 10px; - gap: 12px; - margin-top: 8px; - width: 400px; - display: flex; - justify-content: space-between; - align-items: center; - animation: ${(props) => (props.isLeaving ? slideOut : slideIn)} 0.5s forwards; - &:hover { - animation-play-state: paused; - } -`; - -const NotificationContent = styled.div` - display: flex; - gap: 8px; -`; - -const NotificationDetails = styled.div` - display: flex; - flex-direction: column; - gap: 4px; -`; - -const ButtonContainer = styled.div` - display: flex; - gap: 8px; -`; - -export const NotificationContainer: React.FC = ({ - children, - type, - isLeaving, - seen, -}) => ( - - {children} - -); - -export const NotificationContentWrapper = NotificationContent; -export const NotificationDetailsWrapper = NotificationDetails; -export const NotificationButtonContainer = ButtonContainer; diff --git a/frontend/webapp/components/notification/notification-icon.tsx b/frontend/webapp/components/notification/notification-icon.tsx deleted file mode 100644 index a22e0b402..000000000 --- a/frontend/webapp/components/notification/notification-icon.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React from 'react'; -import styled from 'styled-components'; -import { - BlueInfoIcon, - GreenCheckIcon, - RedErrorIcon, -} from '@keyval-dev/design-system'; - -const IconWrapper = styled.div<{ bgColor: string }>` - width: 32px; - height: 32px; - border-radius: 20px; - display: flex; - align-items: center; - justify-content: center; - background-color: ${({ bgColor }) => bgColor}; -`; - -const InnerIconWrapper = styled.div<{ borderColor: string }>` - width: 16px; - height: 16px; - border-radius: 20px; - display: flex; - align-items: center; - justify-content: center; - border: 2px solid ${({ borderColor }) => borderColor}; -`; - -export const SuccessIcon = () => ( - - - - - -); - -export const ErrorIcon = () => ( - - - - - -); - -export const InfoIcon = () => ( - - - - - -); - -export const getIcon = (type) => { - switch (type) { - case 'success': - return ; - case 'error': - return ; - case 'info': - return ; - default: - return null; - } -}; diff --git a/frontend/webapp/components/notification/notification-list-item.tsx b/frontend/webapp/components/notification/notification-list-item.tsx deleted file mode 100644 index 894657220..000000000 --- a/frontend/webapp/components/notification/notification-list-item.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { ROUTES, timeAgo } from '@/utils'; -import { useRouter } from 'next/navigation'; -import { getIcon } from './notification-icon'; -import { KeyvalLink, KeyvalText } from '@/design.system'; -import { - NotificationButtonContainer, - NotificationDetailsWrapper, -} from './notification-container'; -interface NotificationListItemProps { - id: string; - message: string; - type: 'success' | 'error' | 'info'; - seen: boolean; - title?: string; - crdType?: string; - time?: string; - target?: string; -} - -const NotificationItemContainer = styled.div<{ seen: boolean }>` - border-bottom: 1px solid ${theme.colors.blue_grey}; - padding: 10px; - gap: 12px; - display: flex; - justify-content: space-between; - align-items: center; - background-color: ${({ seen }) => - seen ? theme.colors.light_dark : theme.colors.dark}; - - &:hover { - background-color: ${theme.colors.dark}; - } -`; - -const NotificationContent = styled.div` - display: flex; - width: 300px; - gap: 8px; -`; - -const NotificationListItem: React.FC = ({ - message, - type, - seen, - title, - crdType, - target, - time, -}) => { - const router = useRouter(); - - function onDetailsClick() { - if (target) { - switch (crdType) { - case 'Destination': - router.push(`${ROUTES.UPDATE_DESTINATION}${target}`); - break; - case 'InstrumentedApplication': - case 'InstrumentationInstance': - router.push(`${ROUTES.MANAGE_SOURCE}?${target}`); - break; - default: - break; - } - } - } - return ( - - -
{getIcon(type)}
- - - {title} - - {message} - {time && ( - - {timeAgo(time)} - - )} - -
- - {!!target && ( - - )} - -
- ); -}; - -export default NotificationListItem; diff --git a/frontend/webapp/components/notification/notification-list.tsx b/frontend/webapp/components/notification/notification-list.tsx deleted file mode 100644 index 4d8d4d5cd..000000000 --- a/frontend/webapp/components/notification/notification-list.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { RootState, markAsSeen } from '@/store'; - -import styled from 'styled-components'; -import theme from '@/styles/palette'; -import { BellIcon } from '@keyval-dev/design-system'; -import { KeyvalText } from '@/design.system'; -import { useOnClickOutside } from '@/hooks'; -import NotificationListItem from './notification-list-item'; - -const NotificationListContainer = styled.div` - position: absolute; - top: 50px; - right: 60px; - background-color: ${theme.colors.light_dark}; - border: 1px solid ${theme.colors.blue_grey}; - border-radius: 8px; - max-height: 400px; - overflow-y: auto; - z-index: 1000; -`; - -const BellIconWrapper = styled.div` - position: relative; - padding: 6px; - border-radius: 8px; - border: 1px solid ${theme.colors.blue_grey}; - display: flex; - align-items: center; - &:hover { - background-color: ${theme.colors.dark}; - } -`; - -const NotificationBadge = styled.div` - position: absolute; - top: -4px; - right: -4px; - background-color: red; - color: white; - border-radius: 50%; - width: 16px; - height: 16px; - display: flex; - align-items: center; - justify-content: center; - font-size: 12px; -`; - -const NotificationHeader = styled.div` - padding: 14px; - border-bottom: 1px solid ${theme.colors.blue_grey}; - display: flex; - justify-content: space-between; - align-items: center; -`; - -export const NotificationList: React.FC = () => { - const [showNotifications, setShowNotifications] = useState(false); - - const notifications = useSelector( - (state: RootState) => state.notification.notifications - ); - - const dispatch = useDispatch(); - const containerRef = useRef(null); - const isInitialRender = useRef(true); - useOnClickOutside(containerRef, () => setShowNotifications(false)); - const unseenCount = notifications.filter( - (notification) => !notification.seen - ).length; - - useEffect(() => { - if (isInitialRender.current) { - isInitialRender.current = false; - return; - } - - if (!showNotifications) { - markAllAsSeen(); - } - }, [showNotifications]); - - function markAllAsSeen() { - notifications.forEach((notification) => { - if (!notification.seen) { - dispatch(markAsSeen(notification.id)); - } - }); - } - - return notifications.length > 0 ? ( -
- - setShowNotifications(!showNotifications)} - /> - {unseenCount > 0 && ( - - {unseenCount} - - )} - - {showNotifications && ( - - - - Notifications - - - - {[...notifications].reverse().map((notification) => ( - - ))} - - )} -
- ) : null; -}; diff --git a/frontend/webapp/components/notification/notification-manager.tsx b/frontend/webapp/components/notification/notification-manager.tsx index 845928853..20cb5c66f 100644 --- a/frontend/webapp/components/notification/notification-manager.tsx +++ b/frontend/webapp/components/notification/notification-manager.tsx @@ -1,32 +1,228 @@ -import React from 'react'; -import { useSelector } from 'react-redux'; - -import Notification from './notification'; +import React, { useMemo, useRef, useState } from 'react'; +import Image from 'next/image'; import styled from 'styled-components'; -import { RootState } from '@/store'; +import { useClickNotif } from '@/hooks'; +import { useNotificationStore } from '@/store'; +import { ACTION, getStatusIcon } from '@/utils'; +import { useOnClickOutside, useTimeAgo } from '@/hooks'; +import theme, { hexPercentValues } from '@/styles/theme'; +import { NoDataFound, Text } from '@/reuseable-components'; +import type { Notification, NotificationType } from '@/types'; + +const BellIcon = styled.div` + position: relative; + width: 36px; + height: 36px; + border-radius: 100%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + &:hover { + background-color: ${({ theme }) => theme.colors.white_opacity['008']}; + } +`; + +const LiveBadge = styled.div` + position: absolute; + top: 8px; + right: 8px; + width: 6px; + height: 6px; + border-radius: 100%; + background-color: ${({ theme }) => theme.colors.orange_og}; +`; + +const RelativeContainer = styled.div` + position: relative; +`; + +const AbsoluteContainer = styled.div` + position: absolute; + top: 40px; + right: 0; + z-index: 1; + width: 370px; + height: 400px; + background-color: ${({ theme }) => theme.colors.dropdown_bg}; + border: 1px solid ${({ theme }) => theme.colors.border}; + border-radius: 24px; + box-shadow: 0px 10px 15px -3px ${({ theme }) => theme.colors.primary}, 0px 4px 6px -2px ${({ theme }) => theme.colors.primary}; +`; + +const PopupHeader = styled.div` + display: flex; + align-items: center; + gap: 12px; + padding: 12px 24px; + border-bottom: 1px solid ${({ theme }) => theme.colors.border}; +`; -const NotificationsWrapper = styled.div` - position: fixed; - top: 20px; - right: 20px; +const PopupBody = styled.div` display: flex; flex-direction: column; - align-items: flex-end; - z-index: 1000; + gap: 12px; + padding: 12px; + height: calc(100% - 74px); + border-radius: 24px; + overflow-y: auto; +`; + +const PopupShadow = styled.div` + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 45px; + border-radius: 0 0 24px 24px; + background: linear-gradient(0deg, #242424 0%, rgba(36, 36, 36, 0.64) 50%, rgba(36, 36, 36, 0) 100%); + pointer-events: none; +`; + +const NewCount = styled(Text)` + background-color: ${({ theme }) => theme.colors.orange_soft}; + color: ${({ theme }) => theme.text.primary}; + border-radius: 32px; + width: fit-content; + padding: 2px 8px; `; -export const NotificationManager: React.FC = () => { - const notifications = useSelector( - (state: RootState) => state.notification.notifications +export const NotificationManager = () => { + const { notifications, markAsSeen } = useNotificationStore(); + const unseen = notifications.filter(({ seen }) => !seen); + const unseenCount = unseen.length; + + const [isOpen, setIsOpen] = useState(false); + const toggleOpen = () => setIsOpen((prev) => !prev); + + const containerRef = useRef(null); + + useOnClickOutside(containerRef, () => { + if (isOpen) { + setIsOpen(false); + if (!!unseenCount) unseen.forEach(({ id }) => markAsSeen(id)); + } + }); + + return ( + + + {!!unseenCount && } + logo + + + {isOpen && ( + + + Notifications{' '} + {!!unseenCount && ( + + {unseenCount} new + + )} + + + {!notifications.length ? ( + + ) : ( + notifications.map((notif) => setIsOpen(false)} />) + )} + + + + )} + ); +}; + +const NotifCard = styled.div` + display: flex; + align-items: flex-start; + gap: 12px; + padding: 16px; + border-radius: 16px; + background-color: ${({ theme }) => theme.colors.white_opacity['004']}; + cursor: not-allowed; + &.click-enabled { + cursor: pointer; + &:hover { + background-color: ${({ theme }) => theme.colors.white_opacity['008']}; + } + } +`; + +const StatusIcon = styled.div<{ $type: NotificationType }>` + background-color: ${({ $type, theme }) => theme.text[$type] + hexPercentValues['012']}; + border-radius: 8px; + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; +`; + +const NotifTextWrap = styled.div` + width: 290px; +`; + +const NotifHeaderTextWrap = styled.div` + margin-bottom: 6px; +`; + +const NotifFooterTextWrap = styled.div` + display: flex; + align-items: center; + gap: 6px; +`; + +const NotificationListItem: React.FC void }> = ({ onClick, ...props }) => { + const { id, seen, type, title, message, time, crdType, target } = props; + const canClick = !!crdType && !!target; + + const isDeleted = useMemo(() => { + const deleteAction = ACTION.DELETE.toLowerCase(); + const titleIncludes = title?.toLowerCase().includes(deleteAction); + + return titleIncludes || false; + }, [title, message]); + + const timeAgo = useTimeAgo(); + const clickNotif = useClickNotif(); return ( - - {notifications - .filter((notification) => notification.isNew) - .map((notification) => ( - - ))} - + { + if (canClick) { + onClick(); // this is to close the popup in a controlled manner, to prevent from all notifications being marked as "seen" + clickNotif(props); + } + }} + > + + status + + + + + {message} + + + + + {timeAgo.format(new Date(time))} + + {!seen && ( + <> + · + + new + + + )} + + + ); }; diff --git a/frontend/webapp/components/notification/notification.tsx b/frontend/webapp/components/notification/notification.tsx deleted file mode 100644 index 978e4733a..000000000 --- a/frontend/webapp/components/notification/notification.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { ROUTES } from '@/utils'; -import { useDispatch } from 'react-redux'; -import { useRouter } from 'next/navigation'; -import { getIcon } from './notification-icon'; -import { markAsOld, markAsSeen } from '@/store'; -import { KeyvalLink, KeyvalText } from '@/design.system'; -import { - NotificationContainer, - NotificationContentWrapper, - NotificationDetailsWrapper, - NotificationButtonContainer, -} from './notification-container'; - -interface NotificationProps { - id: string; - message: string; - title?: string; - type: 'success' | 'error' | 'info'; - time?: string; - onClick?: () => void; - crdType?: string; - target?: string; -} - -const Notification: React.FC = ({ - id, - message, - type, - title, - crdType, - target, -}) => { - const dispatch = useDispatch(); - const router = useRouter(); - const [isLeaving, setIsLeaving] = useState(false); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLeaving(true); - setTimeout(() => dispatch(markAsOld(id)), 500); - }, 5000); - - return () => clearTimeout(timer); - }, [id, dispatch]); - - function onDetailsClick() { - dispatch(markAsSeen(id)); - dispatch(markAsOld(id)); - - if (target) { - switch (crdType) { - case 'Destination': - router.push(`${ROUTES.UPDATE_DESTINATION}${target}`); - break; - case 'InstrumentedApplication': - case 'InstrumentationInstance': - router.push(`${ROUTES.MANAGE_SOURCE}?${target}`); - break; - default: - break; - } - } - } - - return ( - - -
{getIcon(type)}
- - - {title} - - {message} - -
- - {!!target && ( - - )} - -
- ); -}; - -export default Notification; diff --git a/frontend/webapp/components/notification/toast-list.tsx b/frontend/webapp/components/notification/toast-list.tsx new file mode 100644 index 000000000..ee3bedf99 --- /dev/null +++ b/frontend/webapp/components/notification/toast-list.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Notification } from '@/types'; +import { useClickNotif } from '@/hooks'; +import { useNotificationStore } from '@/store'; +import { NotificationNote } from '@/reuseable-components'; + +const Container = styled.div` + position: fixed; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + z-index: 10000; + display: flex; + flex-direction: column-reverse; + gap: 6px; + min-width: 600px; +`; + +export const ToastList: React.FC = () => { + const { notifications } = useNotificationStore(); + + return ( + + {notifications + .filter(({ dismissed }) => !dismissed) + .map((notif) => ( + + ))} + + ); +}; + +const Toast: React.FC = (props) => { + const { id, type, title, message, crdType, target } = props; + const { markAsDismissed, markAsSeen } = useNotificationStore(); + const clickNotif = useClickNotif(); + + const onClose = ({ asSeen }) => { + markAsDismissed(id); + if (asSeen) markAsSeen(id); + }; + + return ( + clickNotif(props, { dismissToast: true }), + } + : undefined + } + onClose={onClose} + /> + ); +}; diff --git a/frontend/webapp/components/overview/actions/action.icon/index.tsx b/frontend/webapp/components/overview/actions/action.icon/index.tsx deleted file mode 100644 index 877be406f..000000000 --- a/frontend/webapp/components/overview/actions/action.icon/index.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import { ActionsType } from '@/types'; -import { - AddClusterInfoIcon, - DeleteAttributeIcon, - ErrorSamplerIcon, - RenameAttributeIcon, - ProbabilisticSamplerIcon, - LatencySamplerIcon, - PiiMaskingIcon, -} from '@keyval-dev/design-system'; - -export function ActionIcon({ type, ...props }) { - switch (type) { - case ActionsType.ADD_CLUSTER_INFO: - return ; - case ActionsType.RENAME_ATTRIBUTES: - return ; - case ActionsType.DELETE_ATTRIBUTES: - return ; - case ActionsType.ERROR_SAMPLER: - return ; - case ActionsType.PROBABILISTIC_SAMPLER: - return ; - case ActionsType.LATENCY_SAMPLER: - return ; - case ActionsType.PII_MASKING: - return ; - default: - return null; - } -} diff --git a/frontend/webapp/components/overview/actions/action.yaml/add.cluster.info.yaml.tsx b/frontend/webapp/components/overview/actions/action.yaml/add.cluster.info.yaml.tsx deleted file mode 100644 index 8824adfc4..000000000 --- a/frontend/webapp/components/overview/actions/action.yaml/add.cluster.info.yaml.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { ActionState } from '@/types'; -import { YMLEditor } from '@/design.system'; - -export default function AddClusterInfoYaml({ - data, - setEchoCommand, -}: { - data: ActionState; - setEchoCommand: (value: string) => void; -}) { - const [yaml, setYaml] = useState({}); - useEffect(() => { - if (data.actionName && data.actionName.endsWith(' ')) { - return; - } - - if (data.actionNote && data.actionNote.endsWith(' ')) { - return; - } - - const clusterAttributes = data.actionData?.clusterAttributes.map( - (attr) => ({ - [attr.attributeName]: attr.attributeStringValue, - }) - ); - - const newYaml = { - apiVersion: 'actions.odigos.io/v1alpha1', - kind: 'AddClusterInfo', - metadata: { - generateName: 'da-', - namespace: 'odigos-system', - }, - spec: { - actionName: data.actionName || undefined, - clusterAttributes, - signals: data.selectedMonitors - .filter((m) => m.checked) - .map((m) => m.label.toUpperCase()), - actionNote: data.actionNote || undefined, - }, - }; - - const echoCommand = `echo " - apiVersion: actions.odigos.io/v1alpha1 - kind: AddClusterInfo - metadata: - generateName: da- - namespace: odigos-system - spec: - ${data.actionName ? `actionName: ${data.actionName}` : ''} - ${ - data.actionData?.clusterAttributes - ? `clusterAttributes: - ${data.actionData.clusterAttributes - .map((attr) => ` ${attr.attributeName}: ${attr.attributeStringValue}`) - .join('\n ')}` - : '' - } - signals: - - ${data.selectedMonitors - .filter((m) => m.checked) - .map((m) => m.label.toUpperCase()) - .join('\n - ')} - ${data.actionNote ? `actionNote: ${data.actionNote}` : ''} - " | kubectl create -f - - - `; - setEchoCommand(echoCommand); - setYaml(newYaml); - }, [data]); - - if (Object.keys(yaml).length === 0) { - return null; - } - - return ; -} diff --git a/frontend/webapp/components/overview/actions/action.yaml/delete.attribute.yaml.tsx b/frontend/webapp/components/overview/actions/action.yaml/delete.attribute.yaml.tsx deleted file mode 100644 index 83363934d..000000000 --- a/frontend/webapp/components/overview/actions/action.yaml/delete.attribute.yaml.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { ActionState } from '@/types'; -import { YMLEditor } from '@/design.system'; - -export default function DeleteAttributeYaml({ - data, - setEchoCommand, -}: { - data: ActionState; - setEchoCommand: (value: string) => void; -}) { - const [yaml, setYaml] = useState({}); - - useEffect(() => { - if (data.actionName && data.actionName.endsWith(' ')) { - return; - } - - if (data.actionNote && data.actionNote.endsWith(' ')) { - return; - } - - if (data.actionData?.attributeNamesToDelete) { - if ( - data.actionData.attributeNamesToDelete.some((attr) => - attr.endsWith(' ') - ) - ) { - return; - } - } - - const newYaml = { - apiVersion: 'actions.odigos.io/v1alpha1', - kind: 'DeleteAttribute', - metadata: { - generateName: 'da-', - namespace: 'odigos-system', - }, - spec: { - actionName: data.actionName || undefined, - attributeNamesToDelete: data.actionData?.attributeNamesToDelete, - signals: data.selectedMonitors - .filter((m) => m.checked) - .map((m) => m.label.toUpperCase()), - actionNote: data.actionNote || undefined, - }, - }; - setYaml(newYaml); - - const echoCommand = `echo " - apiVersion: actions.odigos.io/v1alpha1 - kind: DeleteAttribute - metadata: - generateName: da- - namespace: odigos-system - spec: - ${data.actionName ? `actionName: ${data.actionName}` : ''} - ${ - data.actionData?.attributeNamesToDelete - ? `attributeNamesToDelete: - - ${data.actionData?.attributeNamesToDelete - .filter((attr) => attr !== '') - .join('\n - ')}` - : '' - } - signals: - - ${data.selectedMonitors - .filter((m) => m.checked) - .map((m) => m.label.toUpperCase()) - .join('\n - ')} - ${data.actionNote ? `actionNote: ${data.actionNote}` : ''} - " | kubectl create -f - - - `; - setEchoCommand(echoCommand); - }, [data]); - - if (Object.keys(yaml).length === 0) { - return null; - } - - return ; -} diff --git a/frontend/webapp/components/overview/actions/action.yaml/index.tsx b/frontend/webapp/components/overview/actions/action.yaml/index.tsx deleted file mode 100644 index f74aa76b4..000000000 --- a/frontend/webapp/components/overview/actions/action.yaml/index.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React, { useState } from 'react'; -import { ActionState, ActionsType } from '@/types'; -import DeleteAttributeYaml from './delete.attribute.yaml'; -import { KeyvalText } from '@/design.system'; -import styled from 'styled-components'; -import AddClusterInfoYaml from './add.cluster.info.yaml'; - -import theme from '@/styles/palette'; -import { CheckIcon, CopyIcon, YamlIconIcon } from '@keyval-dev/design-system'; - -const CodeBlockWrapper = styled.p` - display: flex; - align-items: center; - font-family: ${theme.font_family.primary}; - color: ${theme.text.light_grey}; - a { - color: ${theme.text.secondary}; - text-decoration: none; - cursor: pointer; - } -`; -const TitleWrapper = styled.div` - display: flex; - align-items: center; - gap: 6px; - margin-bottom: 8px; - max-width: 600px; -`; - -const DescriptionWrapper = styled(TitleWrapper)` - line-height: 1.3; - margin: 10px 0 8px 0; -`; - -interface ActionsYamlProps { - data: ActionState; - onChange: (key: string, value: any) => void; -} - -export function ActionsYaml({ data, onChange }: ActionsYamlProps) { - const [copied, setCopied] = useState(false); - const [echoCommand, setEchoCommand] = useState(''); - - function renderYamlEditor() { - switch (data.type) { - case ActionsType.DELETE_ATTRIBUTES: - return ( - - ); - case ActionsType.ADD_CLUSTER_INFO: - return ( - - ); - default: - return <>; - } - } - - function handleCopy() { - navigator.clipboard.writeText(echoCommand); - setCopied(true); - setTimeout(() => { - setCopied(false); - }, 3000); - } - - return ( -
- - - {`YAML Preview - ${data.type.toLowerCase()}.actions.odigos.io`} - - - - - This is the YAML representation of the action you are creating. You - can use this YAML to create the action using kubectl as well as the - UI. - - - -
{renderYamlEditor()}
-
- - {copied ? ( - - ) : ( - - )} - - Click here - - to copy as kubectl command. - -
-
- ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/add.cluster.info/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/add.cluster.info/index.tsx deleted file mode 100644 index ac594622b..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/add.cluster.info/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import React, { useEffect } from 'react'; -import styled from 'styled-components'; -import { KeyValuePair } from '@/design.system'; -import { KeyValue } from '@keyval-dev/design-system'; - -const DEFAULT_KEY_VALUE_PAIR = [ - { - id: 0, - key: '', - value: '', - }, -]; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface ClusterAttributes { - clusterAttributes: { - attributeName: string; - attributeStringValue: string; - }[]; -} - -interface AddClusterInfoFormProps { - data: ClusterAttributes | null; - onChange: (key: string, keyValues: ClusterAttributes | null) => void; - setIsFormValid?: (value: boolean) => void; -} - -const ACTION_DATA_KEY = 'actionData'; - -export function AddClusterInfoForm({ - data, - onChange, - setIsFormValid = () => {}, -}: AddClusterInfoFormProps): React.JSX.Element { - const [keyValuePairs, setKeyValuePairs] = React.useState([]); - - useEffect(() => { - buildKeyValuePairs(); - }, [data]); - - useEffect(() => { - validateForm(); - }, [keyValuePairs]); - - function handleKeyValuesChange(keyValues: KeyValue[]): void { - const actionData = { - clusterAttributes: keyValues.map((keyValue) => ({ - attributeName: keyValue.key, - attributeStringValue: keyValue.value, - })), - }; - - if ( - actionData.clusterAttributes.length === 1 && - actionData.clusterAttributes[0].attributeName === '' && - actionData.clusterAttributes[0].attributeStringValue === '' - ) { - onChange(ACTION_DATA_KEY, null); - } else { - onChange(ACTION_DATA_KEY, actionData); - } - - setKeyValuePairs(keyValues); // Update state with new key-value pairs - } - - function buildKeyValuePairs() { - if (data?.clusterAttributes.length === 0) { - setKeyValuePairs(DEFAULT_KEY_VALUE_PAIR); - } - - const values = data?.clusterAttributes.map((keyValue, index) => ({ - id: index, - key: keyValue.attributeName, - value: keyValue.attributeStringValue, - })); - - setKeyValuePairs(values || DEFAULT_KEY_VALUE_PAIR); - } - - function validateForm() { - const isValid = keyValuePairs.every( - (pair) => pair.key.trim() !== '' && pair.value.trim() !== '' - ); - setIsFormValid(isValid); - } - - return ( - <> - - - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/delete.attribute/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/delete.attribute/index.tsx deleted file mode 100644 index f05e81c47..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/delete.attribute/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useEffect } from 'react'; -import styled from 'styled-components'; -import { MultiInputTable } from '@/design.system'; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface DeleteAttributes { - attributeNamesToDelete: string[]; -} - -interface DeleteAttributesProps { - data: DeleteAttributes; - onChange: (key: string, value: DeleteAttributes | null) => void; - setIsFormValid?: (value: boolean) => void; -} -const ACTION_DATA_KEY = 'actionData'; - -export function DeleteAttributesForm({ - data, - onChange, - setIsFormValid = () => {}, -}: DeleteAttributesProps): React.JSX.Element { - const [attributeNames, setAttributeNames] = React.useState( - data?.attributeNamesToDelete || [''] - ); - - useEffect(() => { - validateForm(); - }, [attributeNames]); - - function handleOnChange(attributeNamesToDelete: string[]): void { - onChange(ACTION_DATA_KEY, { - attributeNamesToDelete, - }); - setAttributeNames(attributeNamesToDelete); - } - - function validateForm() { - const isValid = attributeNames.every((name) => name.trim() !== ''); - setIsFormValid(isValid); - } - - return ( - <> - - 0 ? attributeNames : ['']} - onValuesChange={handleOnChange} - /> - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/dynamic.action.form/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/dynamic.action.form/index.tsx deleted file mode 100644 index 60b77d20b..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/dynamic.action.form/index.tsx +++ /dev/null @@ -1,53 +0,0 @@ -'use client'; -import React from 'react'; -import { ActionsType } from '@/types'; -import { AddClusterInfoForm } from '../add.cluster.info'; -import { DeleteAttributesForm } from '../delete.attribute'; -import { RenameAttributesForm } from '../rename.attributes'; -import { - ErrorSamplerForm, - LatencySamplerForm, - ProbabilisticSamplerForm, -} from '../samplers'; -import { PiiMaskingForm } from '../pii-masking'; - -interface DynamicActionFormProps { - type?: string; - data: T; - onChange: (key: string, value: T | null) => void; - setIsFormValid?: (isValid: boolean) => void; -} - -export function DynamicActionForm({ - type, - data, - onChange, - setIsFormValid = () => {}, -}: DynamicActionFormProps): React.JSX.Element { - const formComponents = { - [ActionsType.ADD_CLUSTER_INFO]: AddClusterInfoForm, - [ActionsType.DELETE_ATTRIBUTES]: DeleteAttributesForm, - [ActionsType.RENAME_ATTRIBUTES]: RenameAttributesForm, - [ActionsType.ERROR_SAMPLER]: ErrorSamplerForm, - [ActionsType.PROBABILISTIC_SAMPLER]: ProbabilisticSamplerForm, - [ActionsType.LATENCY_SAMPLER]: LatencySamplerForm, - [ActionsType.PII_MASKING]: PiiMaskingForm, - }; - - const FormComponent = type ? formComponents[type] : null; - - return ( - <> - {FormComponent ? ( - - ) : ( -
No action form available
- )} - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/index.tsx deleted file mode 100644 index 95f16f856..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/index.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from './add.cluster.info'; -export * from './dynamic.action.form'; diff --git a/frontend/webapp/components/overview/actions/actions.forms/pii-masking/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/pii-masking/index.tsx deleted file mode 100644 index 88ebb3899..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/pii-masking/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { KeyvalCheckbox } from '@/design.system'; -import React, { useEffect } from 'react'; -import styled from 'styled-components'; - -const piiCategoriesCheckbox = [ - { - id: 'CREDIT_CARD', - label: 'Credit Card', - }, -]; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface PiiMasking { - piiCategories: string[]; -} - -interface PiiMaskingProps { - data: PiiMasking; - onChange: (key: string, value: PiiMasking | null) => void; - setIsFormValid?: (isValid: boolean) => void; -} -const ACTION_DATA_KEY = 'actionData'; -export function PiiMaskingForm({ - data, - onChange, - setIsFormValid, -}: PiiMaskingProps): React.JSX.Element { - useEffect(() => { - onChange(ACTION_DATA_KEY, { - piiCategories: ['CREDIT_CARD'], - }); - setIsFormValid && setIsFormValid(true); - }, []); - - function handleOnChange(value: string): void { - let piiCategories: string[] = []; - - if (piiCategories.includes(value)) { - piiCategories = piiCategories.filter((category) => category !== value); - } else { - piiCategories.push(value); - } - - onChange(ACTION_DATA_KEY, { - piiCategories, - }); - } - - return ( - <> - - {piiCategoriesCheckbox.map((checkbox) => ( - handleOnChange(checkbox?.id)} - label={checkbox?.label} - /> - ))} - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/rename.attributes/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/rename.attributes/index.tsx deleted file mode 100644 index b9b62c122..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/rename.attributes/index.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { useEffect } from 'react'; -import styled from 'styled-components'; -import { KeyValuePair } from '@/design.system'; -import { KeyValue } from '@keyval-dev/design-system'; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface RenameAttributes { - renames: { - [key: string]: string; - }; -} - -interface RenameAttributesProps { - data: RenameAttributes; - onChange: (key: string, value: RenameAttributes) => void; - setIsFormValid?: (value: boolean) => void; -} - -const DEFAULT_KEY_VALUE_PAIR = [ - { - id: 0, - key: '', - value: '', - }, -]; - -const ACTION_DATA_KEY = 'actionData'; - -export function RenameAttributesForm({ - data, - onChange, - setIsFormValid = () => {}, -}: RenameAttributesProps): React.JSX.Element { - const [keyValuePairs, setKeyValuePairs] = React.useState([]); - - useEffect(() => { - buildKeyValuePairs(); - }, [data]); - - useEffect(() => { - validateForm(); - }, [keyValuePairs]); - - function handleKeyValuesChange(keyValues: KeyValue[]): void { - const renames: { - [key: string]: string; - } = {}; - keyValues.forEach((keyValue) => { - renames[keyValue.key] = keyValue.value; - }); - - onChange(ACTION_DATA_KEY, { renames }); - setKeyValuePairs(keyValues); // Update state with new key-value pairs - } - - function buildKeyValuePairs() { - if (!data?.renames) { - setKeyValuePairs(DEFAULT_KEY_VALUE_PAIR); - return; - } - - const values = Object.entries(data.renames).map(([key, value], index) => ({ - id: index, - key, - value, - })); - - setKeyValuePairs(values || DEFAULT_KEY_VALUE_PAIR); - } - - function validateForm() { - const isValid = keyValuePairs.every( - (pair) => pair.key.trim() !== '' && pair.value.trim() !== '' - ); - setIsFormValid(isValid); - } - - return ( - <> - - - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/samplers/error-sampler/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/samplers/error-sampler/index.tsx deleted file mode 100644 index acd15e8cf..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/samplers/error-sampler/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { useEffect } from 'react'; -import styled from 'styled-components'; -import { KeyvalInput } from '@/design.system'; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface ErrorSampler { - fallback_sampling_ratio: number; -} - -interface ErrorSamplerFormProps { - data: ErrorSampler; - onChange: (key: string, value: ErrorSampler | null) => void; - setIsFormValid?: (value: boolean) => void; -} - -const ACTION_DATA_KEY = 'actionData'; - -export function ErrorSamplerForm({ - data, - onChange, - setIsFormValid = () => {}, -}: ErrorSamplerFormProps): React.JSX.Element { - useEffect(() => { - validateForm(); - }, [data?.fallback_sampling_ratio]); - - function handleOnChange(fallback_sampling_ratio: number): void { - onChange(ACTION_DATA_KEY, { - fallback_sampling_ratio, - }); - } - - function validateForm() { - const isValid = - !isNaN(data?.fallback_sampling_ratio) && - data?.fallback_sampling_ratio >= 0 && - data?.fallback_sampling_ratio <= 100; - - setIsFormValid(isValid); - } - - return ( - <> - - handleOnChange(+value)} - type="number" - tooltip="Specifies the ratio of non-error traces you still want to retain" - min={0} - max={100} - error={ - data?.fallback_sampling_ratio > 100 - ? 'Value must be less than 100' - : '' - } - /> - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/samplers/index.ts b/frontend/webapp/components/overview/actions/actions.forms/samplers/index.ts deleted file mode 100644 index 0760d0fa9..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/samplers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './error-sampler'; -export * from './probabilistic-sampler'; -export * from './latency-action'; diff --git a/frontend/webapp/components/overview/actions/actions.forms/samplers/latency-action/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/samplers/latency-action/index.tsx deleted file mode 100644 index 740605a1e..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/samplers/latency-action/index.tsx +++ /dev/null @@ -1,289 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { useSources } from '@/hooks'; -import styled from 'styled-components'; -import { - KeyvalButton, - KeyvalDropDown, - KeyvalInput, - KeyvalLink, - KeyvalText, -} from '@/design.system'; -import theme from '@/styles/palette'; -import { Tooltip } from '@keyval-dev/design-system'; - -const FormWrapper = styled.div` - width: fit-content; -`; - -const Table = styled.table` - margin-top: 8px; - width: 100%; - border-collapse: collapse; -`; - -const TableHeader = styled.th` - text-align: left; - padding-bottom: 4px; -`; - -const TableCell = styled.td` - width: 220px; - padding-bottom: 24px; -`; - -interface HttpRouteFilter { - fallback_sampling_ratio?: number; - minimum_latency_threshold?: number; - http_route?: string; - service_name?: string; - errors?: { - fallback_sampling_ratio?: string; - minimum_latency_threshold?: string; - http_route?: string; - service_name?: string; - }; -} - -interface LatencySampler { - endpoints_filters: HttpRouteFilter[]; -} - -interface LatencySamplerFormProps { - data: LatencySampler; - onChange: (key: string, value: LatencySampler | null) => void; - setIsFormValid?: (value: boolean) => void; -} - -const ACTION_DATA_KEY = 'actionData'; - -export function LatencySamplerForm({ - data, - onChange, - setIsFormValid = () => {}, -}: LatencySamplerFormProps): React.JSX.Element { - const { sources } = useSources(); - const [filters, setFilters] = useState( - data?.endpoints_filters.length ? data.endpoints_filters : [{}] - ); - - useEffect(() => { - if (filters.length === 0) { - setFilters([{}]); - } - checkFormValidity(filters); - }, [filters]); - - const memoizedSources = React.useMemo(() => { - return sources?.map((source, index) => ({ - id: index, - label: source.name, - })); - }, [sources]); - - function handleOnChange(index: number, key: string, value: any): void { - const updatedFilters = filters.map((filter, i) => - i === index ? { ...filter, [key]: value } : filter - ); - setFilters(updatedFilters); - onChange(ACTION_DATA_KEY, { endpoints_filters: updatedFilters }); - checkFormValidity(updatedFilters); - } - - function handleOnBlur(index: number, key: string, value: any): void { - const updatedFilters = filters.map((filter, i) => { - if (i === index) { - const errors = { ...filter.errors }; - switch (key) { - case 'http_route': - if (!value) { - errors[key] = 'Route is required'; - } else if (!value.startsWith('/')) { - errors[key] = 'Route must start with /'; - } else { - delete errors[key]; - } - break; - case 'minimum_latency_threshold': - if (isNaN(value)) { - errors[key] = 'Minimum latency threshold must be a number'; - } else if (value < 0) { - errors[key] = 'Minimum latency threshold must be greater than 0'; - } else { - delete errors[key]; - } - break; - case 'fallback_sampling_ratio': - if (value < 0 || value > 100) { - errors[key] = 'Fallback sampling ratio must be between 0 and 100'; - } else { - delete errors[key]; - } - break; - default: - break; - } - return { ...filter, errors }; - } - return filter; - }); - setFilters(updatedFilters); - onChange(ACTION_DATA_KEY, { endpoints_filters: updatedFilters }); - checkFormValidity(updatedFilters); - } - - function handleAddFilter(): void { - setFilters([...filters, {}]); - } - - function handleRemoveFilter(index: number): void { - const updatedFilters = filters.filter((_, i) => i !== index); - setFilters(updatedFilters); - onChange(ACTION_DATA_KEY, { endpoints_filters: updatedFilters }); - checkFormValidity(updatedFilters); - } - - function checkFormValidity(filters: HttpRouteFilter[]) { - const isValid = filters.every((filter) => { - return ( - filter.service_name && - filter.http_route && - !filter.errors?.http_route && - filter.minimum_latency_threshold !== undefined && - !filter.errors?.minimum_latency_threshold && - filter.fallback_sampling_ratio !== undefined && - !filter.errors?.fallback_sampling_ratio - ); - }); - setIsFormValid(isValid); - } - - function getDropdownValue(serviceName: string): { - id: number; - label: string; - } { - const source = sources.find((source) => source.name === serviceName); - return { - id: 0, - label: source?.name || '', - }; - } - - return ( - - - {'Endpoints Filters'} - - - - - - Service Name - - - Http Route - - - Minimum Latency Threshold (ms) - - - - Fallback Sampling Ratio - - - - - - - {filters.map((filter, index) => ( - - - - handleOnChange(index, 'service_name', value.label) - } - /> - - - - handleOnChange(index, 'http_route', value) - } - onBlur={() => - handleOnBlur(index, 'http_route', filter.http_route) - } - error={filter.errors?.http_route} - placeholder="e.g. /api/v1/users" - type="text" - /> - - - - handleOnChange(index, 'minimum_latency_threshold', +value) - } - onBlur={() => - handleOnBlur( - index, - 'minimum_latency_threshold', - filter.minimum_latency_threshold - ) - } - placeholder="e.g. 1000" - type="number" - min={0} - error={filter.errors?.minimum_latency_threshold} - /> - - - - handleOnChange(index, 'fallback_sampling_ratio', +value) - } - onBlur={() => - handleOnBlur( - index, - 'fallback_sampling_ratio', - filter.fallback_sampling_ratio - ) - } - placeholder="e.g. 20" - type="number" - min={0} - max={100} - error={filter.errors?.fallback_sampling_ratio} - /> - - - {filters.length > 1 && ( - handleRemoveFilter(index)} - /> - )} - - - ))} - -
- = sources.length} - > - - {'+ Add Filter'} - - -
- ); -} diff --git a/frontend/webapp/components/overview/actions/actions.forms/samplers/probabilistic-sampler/index.tsx b/frontend/webapp/components/overview/actions/actions.forms/samplers/probabilistic-sampler/index.tsx deleted file mode 100644 index c8153f08f..000000000 --- a/frontend/webapp/components/overview/actions/actions.forms/samplers/probabilistic-sampler/index.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React, { useEffect } from 'react'; -import styled from 'styled-components'; -import { KeyvalInput } from '@/design.system'; - -const FormWrapper = styled.div` - width: 375px; -`; - -interface ProbabilisticSampler { - sampling_percentage: string; -} - -interface ProbabilisticSamplerProps { - data: ProbabilisticSampler; - onChange: (key: string, value: ProbabilisticSampler | null) => void; - setIsFormValid?: (value: boolean) => void; -} -const ACTION_DATA_KEY = 'actionData'; - -export function ProbabilisticSamplerForm({ - data, - onChange, - setIsFormValid = () => {}, -}: ProbabilisticSamplerProps): React.JSX.Element { - useEffect(() => { - validateForm(); - }, [data?.sampling_percentage]); - - function handleOnChange(sampling_percentage: string): void { - onChange(ACTION_DATA_KEY, { - sampling_percentage, - }); - } - - function validateForm() { - const percentage = parseFloat(data?.sampling_percentage); - const isValid = !isNaN(percentage) && percentage >= 0 && percentage <= 100; - setIsFormValid(isValid); - } - - return ( - <> - - handleOnChange(value)} - type="number" - tooltip="Percentage at which items are sampled; = 100 samples all items, 0 rejects all items" - min={0} - max={100} - error={ - parseFloat(data?.sampling_percentage) > 100 - ? 'Value must be less than 100' - : '' - } - /> - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.table/action.row.dynamic.content/index.tsx b/frontend/webapp/components/overview/actions/actions.table/action.row.dynamic.content/index.tsx deleted file mode 100644 index 18fbd9dfd..000000000 --- a/frontend/webapp/components/overview/actions/actions.table/action.row.dynamic.content/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; -import { ActionData, ActionsType } from '@/types'; -import React from 'react'; - -interface ActionRowDynamicContentProps { - item: ActionData; -} - -export default function ActionRowDynamicContent({ - item, -}: ActionRowDynamicContentProps) { - function renderContentByType() { - switch (item.type) { - case ActionsType.ADD_CLUSTER_INFO: - return ( - - {`${item?.spec.clusterAttributes.length} cluster attributes`} - - ); - case ActionsType.DELETE_ATTRIBUTES: - return ( - - {`${item?.spec.attributeNamesToDelete.length} deleted attributes`} - - ); - case ActionsType.RENAME_ATTRIBUTES: - return ( - - {`${Object.keys(item?.spec?.renames).length} renamed attributes`} - - ); - case ActionsType.ERROR_SAMPLER: - return ( - - {`${item?.spec?.fallback_sampling_ratio}% sampling ratio`}s - - ); - case ActionsType.PROBABILISTIC_SAMPLER: - return ( - - {`${item?.spec?.sampling_percentage}% sampling ratio`} - - ); - case ActionsType.LATENCY_SAMPLER: - return ( - - {`${item?.spec?.endpoints_filters.length} endpoints`} - - ); - case ActionsType.PII_MASKING: - return ( - - {`${ - item?.spec?.piiCategories.length === 1 - ? '1 category' - : `${item?.spec?.piiCategories.length} categories` - }`} - - ); - default: - return
{item.type}
; - } - } - - return <>{renderContentByType()}; -} diff --git a/frontend/webapp/components/overview/actions/actions.table/actions.table.header.tsx b/frontend/webapp/components/overview/actions/actions.table/actions.table.header.tsx deleted file mode 100644 index 2afccb88b..000000000 --- a/frontend/webapp/components/overview/actions/actions.table/actions.table.header.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import React, { useState } from 'react'; -import { ACTION, MONITORS, OVERVIEW } from '@/utils'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { ActionsSortType } from '@/types'; -import { ActionsGroup, KeyvalCheckbox, KeyvalText } from '@/design.system'; -import { UnFocusActionIcon } from '@keyval-dev/design-system'; - -const StyledThead = styled.div` - background-color: ${theme.colors.light_dark}; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -`; - -const StyledTh = styled.th` - padding: 10px 20px; - text-align: left; - border-bottom: 1px solid ${theme.colors.blue_grey}; -`; - -const StyledMainTh = styled(StyledTh)` - padding: 10px 20px; - display: flex; - align-items: center; - gap: 8px; -`; - -const ActionGroupContainer = styled.div` - display: flex; - justify-content: flex-end; - padding-right: 20px; - gap: 24px; - flex: 1; -`; - -const SELECT_ALL_CHECKBOX = 'select_all'; - -interface ActionsTableHeaderProps { - data: any[]; - selectedCheckbox: string[]; - onSelectedCheckboxChange: (id: string) => void; - sortActions?: (condition: string) => void; - filterActionsBySignal?: (signals: string[]) => void; - toggleActionStatus?: (ids: string[], disabled: boolean) => void; -} - -export function ActionsTableHeader({ - data, - selectedCheckbox, - onSelectedCheckboxChange, - sortActions, - filterActionsBySignal, - toggleActionStatus, -}: ActionsTableHeaderProps) { - const [currentSortId, setCurrentSortId] = useState(''); - const [groupActions, setGroupActions] = useState([ - 'traces', - 'logs', - 'metrics', - ]); - function onSortClick(id: string) { - setCurrentSortId(id); - sortActions && sortActions(id); - } - - function onGroupClick(id: string) { - let newGroup: string[] = []; - if (groupActions.includes(id)) { - setGroupActions(groupActions.filter((item) => item !== id)); - newGroup = groupActions.filter((item) => item !== id); - } else { - setGroupActions([...groupActions, id]); - newGroup = [...groupActions, id]; - } - - filterActionsBySignal && filterActionsBySignal(newGroup); - } - - function onToggleActionStatus(disabled: boolean) { - toggleActionStatus && toggleActionStatus(selectedCheckbox, disabled); - } - - const actionGroups = [ - { - label: 'Active Status', - subTitle: 'Toggle active status', - disabled: false, - items: [ - { - label: ACTION.ENABLE, - onClick: () => onToggleActionStatus(false), - id: 'enabled', - }, - { - label: ACTION.DISABLE, - onClick: () => onToggleActionStatus(true), - id: 'disabled', - }, - ], - condition: !!selectedCheckbox.length, - }, - - { - label: 'Metrics', - subTitle: 'Display', - items: [ - { - label: MONITORS.TRACES, - onClick: () => onGroupClick(MONITORS.TRACES.toLowerCase()), - id: MONITORS.TRACES.toLowerCase(), - selected: groupActions.includes(MONITORS.TRACES.toLowerCase()), - disabled: - groupActions.length === 1 && - groupActions.includes(MONITORS.TRACES.toLowerCase()), - }, - { - label: MONITORS.LOGS, - onClick: () => onGroupClick(MONITORS.LOGS.toLowerCase()), - id: MONITORS.LOGS.toLowerCase(), - selected: groupActions.includes(MONITORS.LOGS.toLowerCase()), - disabled: - groupActions.length === 1 && - groupActions.includes(MONITORS.LOGS.toLowerCase()), - }, - { - label: MONITORS.METRICS, - onClick: () => onGroupClick(MONITORS.METRICS.toLowerCase()), - id: MONITORS.METRICS.toLowerCase(), - selected: groupActions.includes(MONITORS.METRICS.toLowerCase()), - disabled: - groupActions.length === 1 && - groupActions.includes(MONITORS.METRICS.toLowerCase()), - }, - ], - condition: true, - }, - { - label: 'Sort by', - subTitle: 'Sort by', - items: [ - { - label: 'Type', - onClick: () => onSortClick(ActionsSortType.TYPE), - id: ActionsSortType.TYPE, - selected: currentSortId === ActionsSortType.TYPE, - }, - { - label: 'Action Name', - onClick: () => onSortClick(ActionsSortType.ACTION_NAME), - id: ActionsSortType.ACTION_NAME, - selected: currentSortId === ActionsSortType.ACTION_NAME, - }, - { - label: 'Status', - onClick: () => onSortClick(ActionsSortType.STATUS), - id: ActionsSortType.STATUS, - selected: currentSortId === ActionsSortType.STATUS, - }, - ], - condition: true, - }, - ]; - - return ( - - {/* - */} - - 0} - onChange={() => onSelectedCheckboxChange(SELECT_ALL_CHECKBOX)} - /> - - - {selectedCheckbox.length > 0 - ? `${selectedCheckbox.length} selected` - : `${data.length} ${OVERVIEW.MENU.ACTIONS}`} - - - - - - - ); -} diff --git a/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx b/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx deleted file mode 100644 index 8d89c227b..000000000 --- a/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import React, { useMemo } from 'react'; -import { ACTIONS } from '@/utils'; -import theme from '@/styles/palette'; -import { ActionData } from '@/types'; -import styled, { css } from 'styled-components'; -import { KeyvalCheckbox, KeyvalText } from '@/design.system'; -import ActionRowDynamicContent from './action.row.dynamic.content'; -import { TapList } from '@/components/setup/destination/tap.list/tap.list'; -import { MONITORING_OPTIONS } from '@/components/setup/destination/utils'; -import { ActionIcon } from '../action.icon'; - -const StyledTr = styled.tr` - &:hover { - background-color: ${theme.colors.light_dark}; - } -`; - -const StyledTd = styled.td<{ isFirstRow?: boolean }>` - padding: 10px 20px; - border-top: 1px solid ${theme.colors.blue_grey}; - display: flex; - ${({ isFirstRow }) => - isFirstRow && - css` - border-top: none; - `} -`; - -const StyledMainTd = styled(StyledTd)` - cursor: pointer; - padding: 10px 20px; -`; - -const ActionIconContainer = styled.div` - display: flex; - gap: 8px; - margin-left: 10px; - width: 100%; -`; - -const ActionDetails = styled.div` - display: flex; - flex-direction: column; - gap: 4px; -`; - -const ClusterAttributesContainer = styled.div` - display: flex; - gap: 8px; - align-items: center; -`; - -const StatusIndicator = styled.div<{ disabled: boolean }>` - width: 6px; - height: 6px; - border-radius: 4px; - background-color: ${({ disabled }) => - disabled ? theme.colors.orange_brown : theme.colors.success}; -`; - -const TapListContainer = styled.div` - padding: 0 20px; - display: flex; - align-items: center; -`; - -const TAP_STYLE: React.CSSProperties = { padding: '4px 8px', gap: 4 }; - -const supported_signals = { - traces: { - supported: true, - }, - metrics: { - supported: true, - }, - logs: { - supported: true, - }, -}; - -export function ActionsTableRow({ - item, - index, - data, - selectedCheckbox, - onSelectedCheckboxChange, - onRowClick, -}: { - item: ActionData; - index: number; - data: ActionData[]; - selectedCheckbox: string[]; - onSelectedCheckboxChange: (id: string) => void; - onRowClick: (id: string) => void; -}) { - const monitors = useMemo(() => { - return Object?.entries(supported_signals).reduce((acc, [key, _]) => { - const monitor = MONITORING_OPTIONS.find( - (option) => option.title.toLowerCase() === key - ); - if (monitor && supported_signals[key].supported) { - return [ - ...acc, - { - ...monitor, - tapped: item.spec.signals.includes(key.toUpperCase()), - }, - ]; - } - - return acc; - }, []); - }, [data]); - - return ( - - - onSelectedCheckboxChange(item.id)} - /> - onRowClick(item.id)}> -
- -
- - - {ACTIONS[item?.type || ''].TITLE} - - - - {`${item.spec.actionName || 'Action'} `} - - - - - - {item.spec.notes} - - - - - -
-
-
- ); -} diff --git a/frontend/webapp/components/overview/actions/actions.table/index.tsx b/frontend/webapp/components/overview/actions/actions.table/index.tsx deleted file mode 100644 index 516e7e2ae..000000000 --- a/frontend/webapp/components/overview/actions/actions.table/index.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { ActionData } from '@/types'; -import React, { useState } from 'react'; -import { Table } from '@/design.system'; -import { ActionsTableRow } from './actions.table.row'; -import { ActionsTableHeader } from './actions.table.header'; -import { EmptyList } from '@/components/lists'; -import { OVERVIEW } from '@/utils'; - -type TableProps = { - data: ActionData[]; - onRowClick: (id: string) => void; - sortActions?: (condition: string) => void; - filterActionsBySignal?: (signals: string[]) => void; - toggleActionStatus?: (ids: string[], disabled: boolean) => void; -}; - -const SELECT_ALL_CHECKBOX = 'select_all'; - -export const ActionsTable: React.FC = ({ - data, - onRowClick, - sortActions, - filterActionsBySignal, - toggleActionStatus, -}) => { - const [selectedCheckbox, setSelectedCheckbox] = useState([]); - const [currentPage, setCurrentPage] = useState(1); - const [itemsPerPage, setItemsPerPage] = useState(10); - - const currentPageRef = React.useRef(1); - function onSelectedCheckboxChange(id: string) { - if (id === SELECT_ALL_CHECKBOX) { - if (selectedCheckbox.length > 0) { - setSelectedCheckbox([]); - } else { - const start = (currentPageRef.current - 1) * 10; - const end = currentPageRef.current * 10; - setSelectedCheckbox(data.slice(start, end).map((item) => item.id)); - } - return; - } - - if (selectedCheckbox.includes(id)) { - setSelectedCheckbox(selectedCheckbox.filter((item) => item !== id)); - } else { - setSelectedCheckbox([...selectedCheckbox, id]); - } - } - - function onPaginate(pageNumber: number) { - currentPageRef.current = pageNumber; - selectedCheckbox.length > 0 && setSelectedCheckbox([]); - } - - function renderTableHeader() { - return ( - - ); - } - - function renderEmptyResult() { - return ; - } - - return ( - <> - - data={data} - renderTableHeader={renderTableHeader} - onPaginate={onPaginate} - renderEmptyResult={renderEmptyResult} - currentPage={currentPage} - itemsPerPage={itemsPerPage} - setCurrentPage={setCurrentPage} - setItemsPerPage={setItemsPerPage} - renderTableRows={(item, index) => ( - - )} - /> - - ); -}; diff --git a/frontend/webapp/components/overview/actions/delete.action/index.tsx b/frontend/webapp/components/overview/actions/delete.action/index.tsx deleted file mode 100644 index f9de26562..000000000 --- a/frontend/webapp/components/overview/actions/delete.action/index.tsx +++ /dev/null @@ -1,68 +0,0 @@ -'use client'; -import React, { useState } from 'react'; -import { OVERVIEW } from '@/utils'; -import { ActionIcon } from '@/components'; -import { styled } from 'styled-components'; -import { DangerZone, KeyvalModal, KeyvalText } from '@/design.system'; -import { ModalPositionX, ModalPositionY } from '@/design.system/modal/types'; - -const FieldWrapper = styled.div` - div { - width: 354px; - } -`; - -export function DeleteAction({ - onDelete, - name, - type, -}: { - onDelete: () => void; - name: string | undefined; - type?: string; -}) { - const [showModal, setShowModal] = useState(false); - - const modalConfig = { - title: OVERVIEW.DELETE_ACTION, - showHeader: true, - showOverlay: true, - positionX: ModalPositionX.center, - positionY: ModalPositionY.center, - padding: '20px', - footer: { - primaryBtnText: OVERVIEW.CONFIRM_DELETE_ACTION, - primaryBtnAction: () => { - setShowModal(false); - onDelete(); - }, - }, - }; - - return ( - <> - - setShowModal(true)} - /> - - {showModal && ( - setShowModal(false)} - config={modalConfig} - > -
- -
- - {`${OVERVIEW.DELETE} ${name} Action`} - -
- )} - - ); -} diff --git a/frontend/webapp/components/overview/actions/index.ts b/frontend/webapp/components/overview/actions/index.ts deleted file mode 100644 index 933f7470f..000000000 --- a/frontend/webapp/components/overview/actions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './new.action.card'; -export * from './actions.forms'; -export * from './delete.action'; -export * from './actions.table'; -export * from './action.yaml'; -export * from './action.icon'; diff --git a/frontend/webapp/components/overview/actions/new.action.card/index.tsx b/frontend/webapp/components/overview/actions/new.action.card/index.tsx deleted file mode 100644 index 8a64c670d..000000000 --- a/frontend/webapp/components/overview/actions/new.action.card/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { ActionItemCard } from '@/types'; -import { ActionIcon } from '../action.icon'; -import { KeyvalCard, KeyvalText } from '@/design.system'; - -interface NewActionCardProps { - item: ActionItemCard; - onClick: ({ item }: { item: ActionItemCard }) => void; -} - -const CardContentWrapper = styled.div` - padding: 12px; - display: flex; - flex-direction: column; - height: 100%; - gap: 8px; - border: 1px solid transparent; - cursor: pointer; - &:hover { - border-radius: 24px; - border: 1px solid ${theme.colors.secondary}; - } -`; - -export function NewActionCard({ item, onClick }: NewActionCardProps) { - return ( - - onClick({ item })}> - - - {item.title} - - - {item.description} - - - - ); -} diff --git a/frontend/webapp/components/overview/add-entity/index.tsx b/frontend/webapp/components/overview/add-entity/index.tsx new file mode 100644 index 000000000..1480e50da --- /dev/null +++ b/frontend/webapp/components/overview/add-entity/index.tsx @@ -0,0 +1,112 @@ +import Image from 'next/image'; +import theme from '@/styles/theme'; +import { useOnClickOutside } from '@/hooks'; +import React, { useState, useRef } from 'react'; +import styled, { css } from 'styled-components'; +import { useBooleanStore, useModalStore } from '@/store'; +import { DropdownOption, OVERVIEW_ENTITY_TYPES } from '@/types'; +import { Button, FadeLoader, Text } from '@/reuseable-components'; + +// Styled components for the dropdown UI +const Container = styled.div` + position: relative; + display: inline-block; +`; + +const StyledButton = styled(Button)` + display: flex; + align-items: center; + justify-content: center; + gap: 6px; + min-width: 100px; +`; + +const DropdownListContainer = styled.div` + position: absolute; + right: 0; + top: 48px; + border-radius: 24px; + width: 200px; + overflow-y: auto; + background-color: ${({ theme }) => theme.colors.dropdown_bg}; + border: 1px solid ${({ theme }) => theme.colors.border}; + z-index: 9999; + padding: 12px; +`; + +const DropdownItem = styled.div<{ $selected: boolean }>` + padding: 8px 12px; + cursor: pointer; + border-radius: 24px; + gap: 8px; + display: flex; + align-items: center; + &:hover { + background: ${({ theme }) => theme.colors.white_opacity['008']}; + } + ${({ $selected }) => + $selected && + css` + background: rgba(68, 74, 217, 0.24); + `} +`; + +const ButtonText = styled(Text)` + color: ${({ theme }) => theme.text.primary}; + font-family: ${({ theme }) => theme.font_family.secondary}; + font-weight: 600; +`; + +// Default options for the dropdown +const DEFAULT_OPTIONS: DropdownOption[] = [ + { id: OVERVIEW_ENTITY_TYPES.RULE, value: 'Instrumentation Rule' }, + { id: OVERVIEW_ENTITY_TYPES.SOURCE, value: 'Source' }, + { id: OVERVIEW_ENTITY_TYPES.ACTION, value: 'Action' }, + { id: OVERVIEW_ENTITY_TYPES.DESTINATION, value: 'Destination' }, +]; + +interface AddEntityButtonDropdownProps { + options?: DropdownOption[]; + placeholder?: string; +} + +const AddEntity: React.FC = ({ options = DEFAULT_OPTIONS, placeholder = 'ADD...' }) => { + const { isPolling } = useBooleanStore(); + const { currentModal, setCurrentModal } = useModalStore(); + + const [isDropdownOpen, setIsDropdownOpen] = useState(false); + const dropdownRef = useRef(null); + + useOnClickOutside(dropdownRef, () => setIsDropdownOpen(false)); + + const handleToggle = () => { + setIsDropdownOpen((prev) => !prev); + }; + + const handleSelect = (option: DropdownOption) => { + setCurrentModal(option.id); + setIsDropdownOpen(false); + }; + + return ( + + + {isPolling ? : Add} + {placeholder} + + + {isDropdownOpen && ( + + {options.map((option) => ( + handleSelect(option)}> + {`Add + {option.value} + + ))} + + )} + + ); +}; + +export { AddEntity }; diff --git a/frontend/webapp/components/overview/add.item.menu/index.tsx b/frontend/webapp/components/overview/add.item.menu/index.tsx deleted file mode 100644 index 95c80acd2..000000000 --- a/frontend/webapp/components/overview/add.item.menu/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { PlusIcon } from '@keyval-dev/design-system'; -import { KeyvalText, KeyvalButton } from '@/design.system'; - -const MenuWrapper = styled.div` - display: flex; - justify-content: space-between; - align-items: center; - padding: 20px 36px; -`; - -const BUTTON_STYLES = { gap: 10, height: 40 }; - -interface AddItemMenuProps { - length: number; - onClick: () => void; - btnLabel: string; - lengthLabel: string; -} - -export function AddItemMenu({ - length = 0, - onClick, - btnLabel, - lengthLabel, -}: AddItemMenuProps) { - return ( - - {`${length} ${lengthLabel}`} - - - - {btnLabel} - - - - ); -} diff --git a/frontend/webapp/components/overview/destination/index.ts b/frontend/webapp/components/overview/destination/index.ts deleted file mode 100644 index 304f27783..000000000 --- a/frontend/webapp/components/overview/destination/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './managed.destination.table'; diff --git a/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx b/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx deleted file mode 100644 index fb221b83d..000000000 --- a/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React from 'react'; -import styled from 'styled-components'; -import { KeyvalImage, KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; -import { LinkIcon } from '@keyval-dev/design-system'; - -const ManageDestinationHeaderWrapper = styled.div` - display: flex; - height: 104px; - align-items: center; - border-radius: 25px; - margin: 24px 0; - background: radial-gradient( - 78.09% 72.18% at 100% -0%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), - linear-gradient(180deg, #2e4c55 0%, #303355 100%); -`; - -const TextWrapper = styled.div``; - -const IMAGE_STYLE: React.CSSProperties = { - backgroundColor: '#fff', - padding: 4, - marginRight: 16, - marginLeft: 16, -}; - -export function ManageDestinationHeader({ - data: { image_url, display_name, type }, -}) { - return ( - - - - - {display_name} - -
- window.open(`https://docs.odigos.io/backends/${type}`, '_blank') - } - > - - find out more about {display_name} in{' '} - our docs - - -
-
-
- ); -} diff --git a/frontend/webapp/components/overview/destination/manage.destination/form.danger.zone.tsx b/frontend/webapp/components/overview/destination/manage.destination/form.danger.zone.tsx deleted file mode 100644 index a0a10ec96..000000000 --- a/frontend/webapp/components/overview/destination/manage.destination/form.danger.zone.tsx +++ /dev/null @@ -1,66 +0,0 @@ -'use client'; -import React, { useState } from 'react'; -import { styled } from 'styled-components'; -import { ConnectionsIcons } from '@/components/setup'; -import { DangerZone, KeyvalModal, KeyvalText } from '@/design.system'; -import { ModalPositionX, ModalPositionY } from '@/design.system/modal/types'; -import { OVERVIEW } from '@/utils/constants'; - -const FieldWrapper = styled.div` - margin-top: 32px; - width: 348px; -`; - -const IMAGE_STYLE = { border: 'solid 1px #ededed' }; -export default function FormDangerZone({ - onDelete, - data, -}: { - onDelete: () => void; - data: any; -}) { - const [showModal, setShowModal] = useState(false); - - const modalConfig = { - title: OVERVIEW.DELETE_DESTINATION, - showHeader: true, - showOverlay: true, - positionX: ModalPositionX.center, - positionY: ModalPositionY.center, - padding: '20px', - footer: { - primaryBtnText: OVERVIEW.DELETE_BUTTON, - primaryBtnAction: () => { - onDelete(); - setShowModal(false); - }, - }, - }; - - return ( - <> - - setShowModal(true)} - /> - - {showModal && ( - setShowModal(false)} - config={modalConfig} - > -
- -
- - {`${OVERVIEW.DELETE} ${data?.name}`} - -
- )} - - ); -} diff --git a/frontend/webapp/components/overview/destination/manage.destination/manage.destination.tsx b/frontend/webapp/components/overview/destination/manage.destination/manage.destination.tsx deleted file mode 100644 index 71df6cc86..000000000 --- a/frontend/webapp/components/overview/destination/manage.destination/manage.destination.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; -import { SETUP } from '@/utils'; -import { DestinationType } from '@/types'; -import { styled } from 'styled-components'; -import FormDangerZone from './form.danger.zone'; -import { BackIcon } from '@keyval-dev/design-system'; -import { Conditions, KeyvalText } from '@/design.system'; -import { CreateConnectionForm } from '@/components/setup'; -import { ManageDestinationHeader } from '../manage.destination.header/manage.destination.header'; - -interface ManageDestinationProps { - destinationType: DestinationType; - selectedDestination: any; - onBackClick?: () => void; - onSubmit: (data: any) => void; - onDelete?: () => void; -} - -const BackButtonWrapper = styled.div` - display: flex; - align-items: center; - cursor: pointer; - p { - cursor: pointer !important; - } -`; - -const CreateConnectionWrapper = styled.div` - display: flex; - gap: 10vw; -`; - -export function ManageDestination({ - destinationType, - selectedDestination, - onBackClick, - onSubmit, - onDelete, -}: ManageDestinationProps) { - return ( - <> - {onBackClick && ( - - - {SETUP.BACK} - - )} - - -
- onSubmit(data)} - /> - {onDelete && ( - - )} -
- <> - - -
- - ); -} diff --git a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.header.tsx b/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.header.tsx deleted file mode 100644 index d14e04cce..000000000 --- a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.header.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import React, { useState } from 'react'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { MONITORS, OVERVIEW } from '@/utils'; -import { ActionsGroup, KeyvalText } from '@/design.system'; -import { Destination, DestinationsSortType } from '@/types'; -import { UnFocusDestinationsIcon } from '@keyval-dev/design-system'; - -const StyledThead = styled.div` - background-color: ${theme.colors.light_dark}; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -`; - -const StyledTh = styled.th` - padding: 10px 20px; - text-align: left; - border-bottom: 1px solid ${theme.colors.blue_grey}; -`; - -const StyledMainTh = styled(StyledTh)` - padding: 10px 20px; - display: flex; - align-items: center; - gap: 8px; -`; - -const ActionGroupContainer = styled.div` - display: flex; - justify-content: flex-end; - padding-right: 20px; - gap: 24px; - flex: 1; -`; - -interface DestinationsTableHeaderProps { - data: Destination[]; - sortDestinations?: (condition: string) => void; - filterDestinationsBySignal?: (signals: string[]) => void; -} - -export function DestinationsTableHeader({ - data, - sortDestinations, - filterDestinationsBySignal, -}: DestinationsTableHeaderProps) { - const [currentSortId, setCurrentSortId] = useState(''); - const [groupDestinations, setGroupDestinations] = useState([ - 'traces', - 'logs', - 'metrics', - ]); - function onSortClick(id: string) { - setCurrentSortId(id); - sortDestinations && sortDestinations(id); - } - - function onGroupClick(id: string) { - let newGroup: string[] = []; - if (groupDestinations.includes(id)) { - setGroupDestinations(groupDestinations.filter((item) => item !== id)); - newGroup = groupDestinations.filter((item) => item !== id); - } else { - setGroupDestinations([...groupDestinations, id]); - newGroup = [...groupDestinations, id]; - } - - filterDestinationsBySignal && filterDestinationsBySignal(newGroup); - } - const destinationsGroups = [ - { - label: 'Metrics', - subTitle: 'Display', - items: [ - { - label: MONITORS.TRACES, - onClick: () => onGroupClick(MONITORS.TRACES.toLowerCase()), - id: MONITORS.TRACES.toLowerCase(), - selected: groupDestinations.includes(MONITORS.TRACES.toLowerCase()), - disabled: - groupDestinations.length === 1 && - groupDestinations.includes(MONITORS.TRACES.toLowerCase()), - }, - { - label: MONITORS.LOGS, - onClick: () => onGroupClick(MONITORS.LOGS.toLowerCase()), - id: MONITORS.LOGS.toLowerCase(), - selected: groupDestinations.includes(MONITORS.LOGS.toLowerCase()), - disabled: - groupDestinations.length === 1 && - groupDestinations.includes(MONITORS.LOGS.toLowerCase()), - }, - { - label: MONITORS.METRICS, - onClick: () => onGroupClick(MONITORS.METRICS.toLowerCase()), - id: MONITORS.METRICS.toLowerCase(), - selected: groupDestinations.includes(MONITORS.METRICS.toLowerCase()), - disabled: - groupDestinations.length === 1 && - groupDestinations.includes(MONITORS.METRICS.toLowerCase()), - }, - ], - condition: true, - }, - { - label: 'Sort by', - subTitle: 'Sort by', - items: [ - { - label: 'Type', - onClick: () => onSortClick(DestinationsSortType.TYPE), - id: DestinationsSortType.TYPE, - selected: currentSortId === DestinationsSortType.TYPE, - }, - { - label: 'Name', - onClick: () => onSortClick(DestinationsSortType.NAME), - id: DestinationsSortType.NAME, - selected: currentSortId === DestinationsSortType.NAME, - }, - ], - condition: true, - }, - ]; - - return ( - - - - - {`${data.length} ${OVERVIEW.MENU.DESTINATIONS}`} - - - - - - - ); -} diff --git a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx b/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx deleted file mode 100644 index 3112f6964..000000000 --- a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React, { useMemo } from 'react'; -import theme from '@/styles/palette'; -import { Destination } from '@/types'; -import styled, { css } from 'styled-components'; -import { KeyvalImage, KeyvalText } from '@/design.system'; -import { MONITORING_OPTIONS } from '@/components/setup/destination/utils'; -import { TapList } from '@/components/setup/destination/tap.list/tap.list'; -import { ConditionCheck } from '@/components/common'; - -const StyledTr = styled.tr` - &:hover { - background-color: ${theme.colors.light_dark}; - } -`; - -const StyledTd = styled.td<{ isFirstRow?: boolean }>` - padding: 10px 20px; - border-top: 1px solid ${theme.colors.blue_grey}; - - ${({ isFirstRow }) => - isFirstRow && - css` - border-top: none; - `} -`; - -const StyledMainTd = styled(StyledTd)` - cursor: pointer; - padding: 10px 20px; -`; - -const SourceIconContainer = styled.div` - display: flex; - align-items: center; - gap: 8px; -`; - -const SourceDetails = styled.div` - display: flex; - flex-direction: column; -`; - -const NameContainer = styled.div` - display: flex; - gap: 10px; - align-items: center; -`; - -const FooterContainer = styled.div` - display: flex; - align-items: center; -`; - -const FooterItemWrapper = styled.div` - display: flex; - align-items: center; - gap: 4px; -`; - -const StatusIndicator = styled.div<{ color: string }>` - width: 6px; - height: 6px; - border-radius: 4px; - background-color: ${({ color }) => color}; -`; - -const TagWrapper = styled.div` - padding: 0 20px; - width: 300px; - display: flex; - align-items: center; -`; - -const LOGO_STYLE: React.CSSProperties = { - padding: 4, - backgroundColor: theme.colors.white, -}; -const TAP_STYLE: React.CSSProperties = { padding: '4px 8px', gap: 4 }; -export function DestinationsTableRow({ - item, - index, - onRowClick, -}: { - item: Destination; - index: number; - onRowClick: (source: Destination) => void; -}) { - const monitors = useMemo(() => { - const supported_signals = item.destination_type.supported_signals; - const signals = item.signals; - return Object?.entries(supported_signals).reduce((acc, [key, _]) => { - const monitor = MONITORING_OPTIONS.find( - (option) => option.title.toLowerCase() === key - ); - if (monitor && supported_signals[key].supported) { - return [...acc, { ...monitor, tapped: signals[key] }]; - } - - return acc; - }, []); - }, [JSON.stringify(item.signals)]); - - return ( - - onRowClick(item)} isFirstRow={index === 0}> - -
- -
- - - - {item.destination_type.display_name} - - - - - - {`${item.name || 'Destination'} `} - - - - - - - -
-
-
- ); -} diff --git a/frontend/webapp/components/overview/destination/managed.destination.table/index.tsx b/frontend/webapp/components/overview/destination/managed.destination.table/index.tsx deleted file mode 100644 index f987c0db2..000000000 --- a/frontend/webapp/components/overview/destination/managed.destination.table/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { useState } from 'react'; -import { Table } from '@/design.system'; -import { Destination } from '@/types'; -import { EmptyList } from '@/components/lists'; -import { OVERVIEW } from '@/utils'; -import { DestinationsTableHeader } from './destinations.table.header'; -import { DestinationsTableRow } from './destinations.table.row'; - -type TableProps = { - data: Destination[]; - onRowClick: (source: Destination) => void; - sortDestinations?: (condition: string) => void; - filterDestinationsBySignal?: (signals: string[]) => void; -}; - -export const ManagedDestinationsTable: React.FC = ({ - data, - onRowClick, - sortDestinations, - filterDestinationsBySignal, -}) => { - const [currentPage, setCurrentPage] = useState(1); - const [itemsPerPage, setItemsPerPage] = useState(10); - const currentPageRef = React.useRef(1); - - function onPaginate(pageNumber: number) { - currentPageRef.current = pageNumber; - } - - function renderEmptyResult() { - return ; - } - - function renderTableHeader() { - return ( - - ); - } - - return ( - <> - - data={data} - renderTableHeader={renderTableHeader} - onPaginate={onPaginate} - renderEmptyResult={renderEmptyResult} - currentPage={currentPage} - itemsPerPage={itemsPerPage} - setCurrentPage={setCurrentPage} - setItemsPerPage={setItemsPerPage} - renderTableRows={(item, index) => ( - - )} - /> - - ); -}; diff --git a/frontend/webapp/components/overview/index.tsx b/frontend/webapp/components/overview/index.tsx index 7e5d4344a..a84120e29 100644 --- a/frontend/webapp/components/overview/index.tsx +++ b/frontend/webapp/components/overview/index.tsx @@ -1,8 +1,2 @@ -export { OverviewHeader } from './overview.header/overview.header'; -export { ManageDestination } from './destination/manage.destination/manage.destination'; -export { DeleteSource } from './sources/delete.source/delete.source'; - -export * from './add.item.menu'; -export * from './actions'; -export * from './sources'; -export * from './destination'; +export * from './add-entity'; +export * from './monitors-legend'; diff --git a/frontend/webapp/components/overview/instrumentation-rules/rules-table/index.tsx b/frontend/webapp/components/overview/instrumentation-rules/rules-table/index.tsx deleted file mode 100644 index cffef68b7..000000000 --- a/frontend/webapp/components/overview/instrumentation-rules/rules-table/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useState } from 'react'; -import { Table } from '@/design.system'; -import { EmptyList } from '@/components/lists'; -import { InstrumentationRuleSpec } from '@/types'; -import { InstrumentationRulesTableRow } from './instrumentation.rules.table.row'; -import { InstrumentationRulesTableHeader } from './instrumentation.rules.table.header'; - -type TableProps = { - data: InstrumentationRuleSpec[]; - onRowClick: (id: string) => void; -}; - -export const InstrumentationRulesTable: React.FC = ({ - data, - onRowClick, -}) => { - const [selectedCheckbox, setSelectedCheckbox] = useState([]); - const [currentPage, setCurrentPage] = useState(1); - const [itemsPerPage, setItemsPerPage] = useState(10); - - const currentPageRef = React.useRef(1); - - function onPaginate(pageNumber: number) { - currentPageRef.current = pageNumber; - selectedCheckbox.length > 0 && setSelectedCheckbox([]); - } - - function renderTableHeader() { - return ; - } - - function renderEmptyResult() { - return ; - } - - return ( - <> - - data={data} - renderTableHeader={renderTableHeader} - onPaginate={onPaginate} - renderEmptyResult={renderEmptyResult} - currentPage={currentPage} - itemsPerPage={itemsPerPage} - setCurrentPage={setCurrentPage} - setItemsPerPage={setItemsPerPage} - renderTableRows={(item, index) => ( - - )} - /> - - ); -}; diff --git a/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.header.tsx b/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.header.tsx deleted file mode 100644 index 06024a700..000000000 --- a/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.header.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import { Funnel } from '@/assets'; -import { OVERVIEW } from '@/utils'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { KeyvalText } from '@/design.system'; - -const StyledThead = styled.div` - background-color: ${theme.colors.light_dark}; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -`; - -const StyledTh = styled.th` - padding: 10px 20px; - text-align: left; - border-bottom: 1px solid ${theme.colors.blue_grey}; -`; - -const StyledMainTh = styled(StyledTh)` - padding: 10px 20px; - display: flex; - align-items: center; - gap: 8px; -`; - -interface InstrumentationRulesTableHeaderProps { - data: any[]; -} - -export function InstrumentationRulesTableHeader({ - data, -}: InstrumentationRulesTableHeaderProps) { - return ( - - - - - {`${data.length} ${OVERVIEW.MENU.INSTRUMENTATION_RULES}`} - - - - ); -} diff --git a/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.row.tsx b/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.row.tsx deleted file mode 100644 index 25c675edc..000000000 --- a/frontend/webapp/components/overview/instrumentation-rules/rules-table/instrumentation.rules.table.row.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import { KeyvalText } from '@/design.system'; -import styled, { css } from 'styled-components'; -import { INSTRUMENTATION_RULES } from '@/utils'; -import { PayloadCollectionIcon } from '@/assets'; -import { InstrumentationRuleSpec } from '@/types'; -import RuleRowDynamicContent from './rule.row.dynamic.content'; - -const StyledTr = styled.tr` - &:hover { - background-color: ${theme.colors.light_dark}; - } -`; - -const StyledTd = styled.td<{ isFirstRow?: boolean }>` - padding: 10px 20px; - border-top: 1px solid ${theme.colors.blue_grey}; - display: flex; - ${({ isFirstRow }) => - isFirstRow && - css` - border-top: none; - `} -`; - -const StyledMainTd = styled(StyledTd)` - cursor: pointer; - padding: 10px 20px; -`; - -const RuleIconContainer = styled.div` - display: flex; - gap: 8px; - margin-left: 10px; - width: 100%; -`; - -const RuleDetails = styled.div` - display: flex; - flex-direction: column; - gap: 4px; -`; - -const ClusterAttributesContainer = styled.div` - display: flex; - gap: 8px; - align-items: center; -`; - -export function InstrumentationRulesTableRow({ - item, - index, - onRowClick, -}: { - item: InstrumentationRuleSpec; - index: number; - onRowClick: (id: string) => void; -}) { - return ( - - onRowClick(item?.ruleId || '')} - > - -
- -
- - - {INSTRUMENTATION_RULES['payload-collection'].TITLE} - - - - {`${item?.ruleName || 'Rule'}`} - - - - - {item?.notes} - - -
-
-
- ); -} diff --git a/frontend/webapp/components/overview/instrumentation-rules/rules-table/rule.row.dynamic.content.tsx b/frontend/webapp/components/overview/instrumentation-rules/rules-table/rule.row.dynamic.content.tsx deleted file mode 100644 index c0543ba41..000000000 --- a/frontend/webapp/components/overview/instrumentation-rules/rules-table/rule.row.dynamic.content.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; -import { InstrumentationRuleSpec, RulesType } from '@/types'; -import React from 'react'; - -interface RuleRowDynamicContentProps { - item: InstrumentationRuleSpec; -} - -export default function RuleRowDynamicContent({ - item, -}: RuleRowDynamicContentProps) { - function renderContentByType() { - switch ('payload-collection') { - case RulesType.PAYLOAD_COLLECTION: - return ( - - {' '} - - ); - - default: - return
; - } - } - - return <>{renderContentByType()}; -} diff --git a/frontend/webapp/components/overview/monitors-legend/index.tsx b/frontend/webapp/components/overview/monitors-legend/index.tsx new file mode 100644 index 000000000..1c4c0eee8 --- /dev/null +++ b/frontend/webapp/components/overview/monitors-legend/index.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import Image from 'next/image'; +import theme from '@/styles/theme'; +import styled from 'styled-components'; +import { MONITORS_OPTIONS } from '@/utils'; +import { Text } from '@/reuseable-components'; + +const List = styled.div` + display: flex; + align-items: center; + gap: 12px; +`; + +const ListItem = styled.div` + display: flex; + align-items: center; + gap: 4px; +`; + +const MonitorTitle = styled(Text)` + color: ${({ theme }) => theme.text.grey}; + font-size: 12px; + font-weight: 300; + line-height: 150%; +`; + +const MonitorsLegend = () => { + return ( + + {MONITORS_OPTIONS.map(({ id, value }) => ( + + {value} + + + {value} + + + ))} + + ); +}; + +export { MonitorsLegend }; diff --git a/frontend/webapp/components/overview/overview.header/overview.header.tsx b/frontend/webapp/components/overview/overview.header/overview.header.tsx deleted file mode 100644 index 90d72948b..000000000 --- a/frontend/webapp/components/overview/overview.header/overview.header.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React from 'react'; -import { SETUP } from '@/utils'; -import styled from 'styled-components'; -import { KeyvalText } from '@/design.system'; -import { NotificationList } from '@/components'; -import { BackIcon } from '@keyval-dev/design-system'; -import { OdigosDescriptionDrawer } from '@/containers'; - -export interface OverviewHeaderProps { - title?: string; - onBackClick?: any; - isDisabled?: boolean; -} - -const OverviewHeaderContainer = styled.div` - display: flex; - justify-content: space-between; - align-items: center; - padding-right: 24px; - border-bottom: 2px solid rgba(255, 255, 255, 0.08); - background: ${({ theme }) => theme.colors.light_dark}; -`; - -const HeaderTop = styled.div` - display: flex; - flex-direction: column; - margin-top: 2vh; - margin-left: 24px; - margin-bottom: 2vh; - gap: 8px; -`; - -const BackButtonWrapper = styled.div` - display: flex; - cursor: pointer; - p { - cursor: pointer !important; - } -`; - -export function OverviewHeader({ title, onBackClick }: OverviewHeaderProps) { - return ( - - - {onBackClick && ( - - - {SETUP.BACK} - - )} - - {title} - - -
- {!onBackClick && } - {title === 'Overview' && } -
-
- ); -} diff --git a/frontend/webapp/components/overview/sources/delete.source/delete.source.tsx b/frontend/webapp/components/overview/sources/delete.source/delete.source.tsx deleted file mode 100644 index d4c73cac0..000000000 --- a/frontend/webapp/components/overview/sources/delete.source/delete.source.tsx +++ /dev/null @@ -1,68 +0,0 @@ -'use client'; -import React, { useState } from 'react'; -import { styled } from 'styled-components'; -import { ConnectionsIcons } from '@/components/setup'; -import { DangerZone, KeyvalModal, KeyvalText } from '@/design.system'; -import { ModalPositionX, ModalPositionY } from '@/design.system/modal/types'; -import { OVERVIEW } from '@/utils/constants'; - -const FieldWrapper = styled.div` - margin-top: 32px; - width: 348px; -`; - -const IMAGE_STYLE = { border: 'solid 1px #ededed' }; -export function DeleteSource({ - onDelete, - name, - image_url, -}: { - onDelete: () => void; - name: string | undefined; - image_url: string; -}) { - const [showModal, setShowModal] = useState(false); - - const modalConfig = { - title: OVERVIEW.DELETE_SOURCE, - showHeader: true, - showOverlay: true, - positionX: ModalPositionX.center, - positionY: ModalPositionY.center, - padding: '20px', - footer: { - primaryBtnText: OVERVIEW.CONFIRM_SOURCE_DELETE, - primaryBtnAction: () => { - setShowModal(false); - onDelete(); - }, - }, - }; - - return ( - <> - - setShowModal(true)} - /> - - {showModal && ( - setShowModal(false)} - config={modalConfig} - > -
- -
- - {`${OVERVIEW.DELETE} ${name}`} - -
- )} - - ); -} diff --git a/frontend/webapp/components/overview/sources/detected-containers/index.tsx b/frontend/webapp/components/overview/sources/detected-containers/index.tsx deleted file mode 100644 index ab2a51dc3..000000000 --- a/frontend/webapp/components/overview/sources/detected-containers/index.tsx +++ /dev/null @@ -1,90 +0,0 @@ -// DetectedContainers.tsx -import { KeyvalText } from '@/design.system'; -import theme from '@/styles/palette'; -import { Condition } from '@/types'; -import React from 'react'; -import styled from 'styled-components'; - -// Define the types for the language object -interface Language { - container_name: string; - language: string; - runtime_version?: string; - other_agent?: { [name: string]: string }; -} - -interface DetectedContainersProps { - languages: Language[]; - conditions: Condition[]; -} - -const Container = styled.div` - margin-top: 16px; - max-width: 36vw; - margin-bottom: 24px; - border: 1px solid #374a5b; - border-radius: 8px; - padding: 24px; -`; - -const List = styled.ul` - list-style: disc; -`; - -const ListItem = styled.li` - padding: 2px 0; - &::marker { - color: ${theme.colors.white}; - } -`; - -const DetectedContainers: React.FC = ({ - languages, - conditions, -}) => { - const hasError = conditions.some((condition) => condition.status === 'False'); - return ( - - - Detected Containers: - - - {languages.map((lang) => { - const isInstrumented = - lang.language !== 'ignore' && - lang.language !== 'unknown' && - !lang?.other_agent; - return ( - - - {lang.container_name} (Language: {lang.language} - {lang?.runtime_version - ? `, Runtime: ${lang.runtime_version}` - : ''} - ){isInstrumented && !hasError && ' - Instrumented'} - - {lang.other_agent && lang.other_agent.name && ( - - {`We detected another agent of ${lang.other_agent.name} that running in the container. Disable it - to instrument this source.`} - - )} - - ); - })} - - - Note: The system automatically instruments the containers it detects - with a supported programming language. - - - ); -}; - -export { DetectedContainers }; diff --git a/frontend/webapp/components/overview/sources/index.ts b/frontend/webapp/components/overview/sources/index.ts deleted file mode 100644 index e4590729e..000000000 --- a/frontend/webapp/components/overview/sources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './managed.sources.table'; -export * from './detected-containers'; diff --git a/frontend/webapp/components/overview/sources/manage.source.header/manage.source.header.tsx b/frontend/webapp/components/overview/sources/manage.source.header/manage.source.header.tsx deleted file mode 100644 index 0c4a0d5c6..000000000 --- a/frontend/webapp/components/overview/sources/manage.source.header/manage.source.header.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import styled from 'styled-components'; -import { KeyvalImage, KeyvalText } from '@/design.system'; -import { ManagedSource } from '@/types/sources'; -import { LANGUAGES_LOGOS, getMainContainerLanguage } from '@/utils'; - -const ManageSourceHeaderWrapper = styled.div` - display: flex; - width: 100%; - min-width: 686px; - height: 104px; - align-items: center; - border-radius: 25px; - margin: 24px 0; - background: radial-gradient( - 78.09% 72.18% at 100% -0%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), - linear-gradient(180deg, #2e4c55 0%, #303355 100%); -`; - -const IMAGE_STYLE: React.CSSProperties = { - backgroundColor: '#fff', - padding: 4, - marginRight: 16, - marginLeft: 16, -}; - -export function ManageSourceHeader({ source }: { source: ManagedSource }) { - const mainLanguage = getMainContainerLanguage(source); - const imageUrl = LANGUAGES_LOGOS[mainLanguage]; - return ( - - -
- - {source.name} - - - {source.kind} in namespace "{source.namespace}" - -
-
- ); -} diff --git a/frontend/webapp/components/overview/sources/managed.sources.table/index.tsx b/frontend/webapp/components/overview/sources/managed.sources.table/index.tsx deleted file mode 100644 index 0738ed4f0..000000000 --- a/frontend/webapp/components/overview/sources/managed.sources.table/index.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import React, { useState } from 'react'; -import { KeyvalModal, KeyvalText, Table } from '@/design.system'; -import { ManagedSource, Namespace } from '@/types'; -import { SourcesTableRow } from './sources.table.row'; -import { SourcesTableHeader } from './sources.table.header'; -import { EmptyList } from '@/components/lists'; -import { OVERVIEW } from '@/utils'; - -import { ModalPositionX, ModalPositionY } from '@/design.system/modal/types'; - -type TableProps = { - data: ManagedSource[]; - namespaces?: Namespace[]; - onRowClick: (source: ManagedSource) => void; - sortSources?: (condition: string) => void; - filterSourcesByKind?: (kinds: string[]) => void; - filterSourcesByNamespace?: (namespaces: string[]) => void; - filterSourcesByLanguage?: (languages: string[]) => void; - deleteSourcesHandler?: (sources: ManagedSource[]) => void; - filterByConditionStatus?: (status: 'All' | 'True' | 'False') => void; - filterByConditionMessage: (message: string[]) => void; -}; - -const SELECT_ALL_CHECKBOX = 'select_all'; - -export const ManagedSourcesTable: React.FC = ({ - data, - namespaces, - onRowClick, - sortSources, - filterSourcesByKind, - deleteSourcesHandler, - filterSourcesByNamespace, - filterSourcesByLanguage, - filterByConditionStatus, - filterByConditionMessage, -}) => { - const [selectedCheckbox, setSelectedCheckbox] = useState([]); - const [showModal, setShowModal] = useState(false); - const [currentPage, setCurrentPage] = useState(1); - const [itemsPerPage, setItemsPerPage] = useState(10); - - const modalConfig = { - title: OVERVIEW.DELETE_SOURCE, - showHeader: true, - showOverlay: true, - positionX: ModalPositionX.center, - positionY: ModalPositionY.center, - padding: '20px', - footer: { - primaryBtnText: OVERVIEW.CONFIRM_SOURCE_DELETE, - primaryBtnAction: () => { - setShowModal(false); - parseSelectedSources(); - }, - }, - }; - const currentPageRef = React.useRef(1); - - function onPaginate(pageNumber: number) { - currentPageRef.current = pageNumber; - } - - function renderEmptyResult() { - return ; - } - - function onSelectedCheckboxChange(id: string) { - const start = (currentPage - 1) * itemsPerPage; - const end = currentPage * itemsPerPage; - const slicedData = data.slice(start, end); - if (id === SELECT_ALL_CHECKBOX) { - if (selectedCheckbox.length === slicedData.length) { - setSelectedCheckbox([]); - } else { - setSelectedCheckbox(slicedData.map((item) => JSON.stringify(item))); - } - return; - } - - if (selectedCheckbox.includes(id)) { - setSelectedCheckbox(selectedCheckbox.filter((item) => item !== id)); - } else { - setSelectedCheckbox([...selectedCheckbox, id]); - } - } - - function parseSelectedSources() { - const selectedSources = selectedCheckbox.map((item) => JSON.parse(item)); - deleteSourcesHandler && deleteSourcesHandler(selectedSources); - setSelectedCheckbox([]); - } - - const indexOfLastItem = currentPage * itemsPerPage; - const indexOfFirstItem = indexOfLastItem - itemsPerPage; - const currentItems = data.slice(indexOfFirstItem, indexOfLastItem); - - function renderTableHeader() { - return ( - <> - setShowModal(true)} - filterByConditionStatus={filterByConditionStatus} - filterByConditionMessage={filterByConditionMessage} - currentItems={currentItems} - /> - {showModal && ( - setShowModal(false)} - config={modalConfig} - > - - {`${OVERVIEW.DELETE} ${selectedCheckbox.length} sources`} - - - )} - - ); - } - - return ( - <> - - data={data} - renderTableHeader={renderTableHeader} - onPaginate={onPaginate} - renderEmptyResult={renderEmptyResult} - renderTableRows={(item, index) => ( - - )} - currentPage={currentPage} - itemsPerPage={itemsPerPage} - setCurrentPage={setCurrentPage} - setItemsPerPage={setItemsPerPage} - /> - - ); -}; diff --git a/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.header.tsx b/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.header.tsx deleted file mode 100644 index 38b916316..000000000 --- a/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.header.tsx +++ /dev/null @@ -1,421 +0,0 @@ -import React, { useEffect, useMemo, useState } from 'react'; -import { OVERVIEW } from '@/utils'; -import theme from '@/styles/palette'; -import styled from 'styled-components'; -import { - ActionsGroup, - KeyvalCheckbox, - KeyvalLink, - KeyvalSwitch, - KeyvalText, -} from '@/design.system'; -import { ManagedSource, Namespace } from '@/types'; -import { UnFocusSourcesIcon } from '@keyval-dev/design-system'; -import { useSources } from '@/hooks'; - -enum K8SSourceTypes { - DEPLOYMENT = 'deployment', - STATEFUL_SET = 'statefulset', - DAEMON_SET = 'daemonset', -} -enum SourceSortOptions { - NAME = 'name', - KIND = 'kind', - NAMESPACE = 'namespace', - LANGUAGE = 'language', -} -const StyledThead = styled.div` - background-color: ${theme.colors.light_dark}; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -`; - -const StyledTh = styled.th` - padding: 10px 20px; - text-align: left; - border-bottom: 1px solid ${theme.colors.blue_grey}; -`; - -const StyledMainTh = styled(StyledTh)` - padding: 10px 20px; - display: flex; - align-items: center; - gap: 8px; -`; - -const ActionGroupContainer = styled.div` - display: flex; - justify-content: flex-end; - padding-right: 20px; - gap: 24px; - flex: 1; -`; -const SELECT_ALL_CHECKBOX = 'select_all'; -interface ActionsTableHeaderProps { - data: ManagedSource[]; - namespaces?: Namespace[]; - sortSources?: (condition: string) => void; - filterSourcesByKind?: (kinds: string[]) => void; - filterSourcesByNamespace?: (namespaces: string[]) => void; - selectedCheckbox: string[]; - onSelectedCheckboxChange: (id: string) => void; - deleteSourcesHandler: () => void; - filterSourcesByLanguage?: (languages: string[]) => void; - filterByConditionStatus?: (status: 'All' | 'True' | 'False') => void; - filterByConditionMessage: (message: string[]) => void; - currentItems: ManagedSource[]; -} - -export function SourcesTableHeader({ - data, - namespaces, - sortSources, - filterSourcesByKind, - filterSourcesByNamespace, - filterSourcesByLanguage, - deleteSourcesHandler, - selectedCheckbox, - onSelectedCheckboxChange, - filterByConditionStatus, - filterByConditionMessage, - currentItems, -}: ActionsTableHeaderProps) { - const [currentSortId, setCurrentSortId] = useState(''); - const [groupNamespaces, setGroupNamespaces] = useState([]); - const [showSourcesWithIssues, setShowSourcesWithIssues] = useState(false); - const [groupErrorMessage, setGroupErrorMessage] = useState([]); - const [groupLanguages, setGroupLanguages] = useState([ - 'javascript', - 'python', - 'java', - 'go', - 'dotnet', - ]); - const [groupKinds, setGroupKinds] = useState([ - K8SSourceTypes.DEPLOYMENT, - K8SSourceTypes.STATEFUL_SET, - K8SSourceTypes.DAEMON_SET, - ]); - - const { groupErrorMessages } = useSources(); - - useEffect(() => { - if (!filterByConditionStatus) { - return; - } - - setGroupErrorMessage(groupErrorMessages()); - - showSourcesWithIssues - ? filterByConditionStatus('False') - : filterByConditionStatus('All'); - }, [showSourcesWithIssues]); - - useEffect(() => { - if (namespaces) { - setGroupNamespaces( - namespaces.filter((item) => item.totalApps > 0).map((item) => item.name) - ); - } - }, [namespaces]); - - function onSortClick(id: string) { - setCurrentSortId(id); - sortSources && sortSources(id); - } - - function onNamespaceClick(id: string) { - let newGroup: string[] = []; - if (groupNamespaces.includes(id)) { - setGroupNamespaces(groupNamespaces.filter((item) => item !== id)); - newGroup = groupNamespaces.filter((item) => item !== id); - } else { - setGroupNamespaces([...groupNamespaces, id]); - newGroup = [...groupNamespaces, id]; - } - - filterSourcesByNamespace && filterSourcesByNamespace(newGroup); - } - - function onKindClick(id: string) { - let newGroup: string[] = []; - if (groupKinds.includes(id)) { - setGroupKinds(groupKinds.filter((item) => item !== id)); - newGroup = groupKinds.filter((item) => item !== id); - } else { - setGroupKinds([...groupKinds, id]); - newGroup = [...groupKinds, id]; - } - - filterSourcesByKind && filterSourcesByKind(newGroup); - } - - function onLanguageClick(id: string) { - let newGroup: string[] = []; - if (groupLanguages.includes(id)) { - setGroupLanguages(groupLanguages.filter((item) => item !== id)); - newGroup = groupLanguages.filter((item) => item !== id); - } else { - setGroupLanguages([...groupLanguages, id]); - newGroup = [...groupLanguages, id]; - } - - filterSourcesByLanguage && filterSourcesByLanguage(newGroup); - } - - function onErrorClick(message: string) { - let newGroup: string[] = []; - if (groupErrorMessage.includes(message)) { - setGroupErrorMessage( - groupErrorMessage.filter((item) => item !== message) - ); - newGroup = groupErrorMessage.filter((item) => item !== message); - } else { - setGroupErrorMessage([...groupErrorMessage, message]); - newGroup = [...groupErrorMessage, message]; - } - - filterByConditionMessage(newGroup); - } - - const sourcesGroups = useMemo(() => { - if (!namespaces) return []; - - const totalNamespacesWithApps = namespaces.filter( - (item) => item.totalApps > 0 - ).length; - - const namespacesItems = namespaces - .sort((a, b) => b.totalApps - a.totalApps) - ?.map((item: Namespace, index: number) => ({ - label: `${item.name} (${item.totalApps} apps) `, - onClick: () => onNamespaceClick(item.name), - id: item.name, - selected: groupNamespaces.includes(item.name) && item.totalApps > 0, - disabled: - (groupNamespaces.length === 1 && - groupNamespaces.includes(item.name)) || - item.totalApps === 0 || - totalNamespacesWithApps === 1, - })); - - const actionsGroup = [ - { - label: 'Language', - subTitle: 'Filter', - condition: true, - items: [ - { - label: 'Javascript', - onClick: () => onLanguageClick('javascript'), - id: 'javascript', - selected: groupLanguages.includes('javascript'), - disabled: - (groupLanguages.length === 1 && - groupLanguages.includes('javascript')) || - (data.length === 1 && - data?.[0]?.instrumented_application_details?.languages?.[0] - .language === 'javascript'), - }, - { - label: 'Python', - onClick: () => onLanguageClick('python'), - id: 'python', - selected: groupLanguages.includes('python'), - disabled: - (groupLanguages.length === 1 && - groupLanguages.includes('python')) || - (data.length === 1 && - data?.[0]?.instrumented_application_details?.languages?.[0] - .language === 'python'), - }, - { - label: 'Java', - onClick: () => onLanguageClick('java'), - id: 'java', - selected: groupLanguages.includes('java'), - disabled: - (groupLanguages.length === 1 && - groupLanguages.includes('java')) || - (data.length === 1 && - data?.[0]?.instrumented_application_details?.languages?.[0] - .language === 'java'), - }, - { - label: 'Go', - onClick: () => onLanguageClick('go'), - id: 'go', - selected: groupLanguages.includes('go'), - disabled: - (groupLanguages.length === 1 && groupLanguages.includes('go')) || - (data.length === 1 && - data?.[0]?.instrumented_application_details?.languages?.[0] - .language === 'go'), - }, - { - label: '.NET', - onClick: () => onLanguageClick('dotnet'), - id: 'dotnet', - selected: groupLanguages.includes('dotnet'), - disabled: - (groupLanguages.length === 1 && - groupLanguages.includes('dotnet')) || - (data.length === 1 && - data?.[0]?.instrumented_application_details?.languages?.[0] - .language === 'dotnet'), - }, - ], - }, - { - label: 'Kind', - subTitle: 'Filter', - condition: true, - items: [ - { - label: 'Deployment', - onClick: () => onKindClick(K8SSourceTypes.DEPLOYMENT), - id: K8SSourceTypes.DEPLOYMENT, - selected: - groupKinds.includes(K8SSourceTypes.DEPLOYMENT) && - data.some( - (item) => item.kind.toLowerCase() === K8SSourceTypes.DEPLOYMENT - ), - disabled: - groupKinds.length === 1 && - groupKinds.includes(K8SSourceTypes.DEPLOYMENT) && - data.some( - (item) => item.kind.toLowerCase() === K8SSourceTypes.DEPLOYMENT - ), - }, - { - label: 'StatefulSet', - onClick: () => onKindClick(K8SSourceTypes.STATEFUL_SET), - id: K8SSourceTypes.STATEFUL_SET, - selected: - groupKinds.includes(K8SSourceTypes.STATEFUL_SET) && - data.some( - (item) => - item.kind.toLowerCase() === K8SSourceTypes.STATEFUL_SET - ), - disabled: - (groupKinds.length === 1 && - groupKinds.includes(K8SSourceTypes.STATEFUL_SET)) || - data.every( - (item) => - item.kind.toLowerCase() !== K8SSourceTypes.STATEFUL_SET - ), - }, - { - label: 'DemonSet', - onClick: () => onKindClick(K8SSourceTypes.DAEMON_SET), - id: K8SSourceTypes.DAEMON_SET, - selected: - groupKinds.includes(K8SSourceTypes.DAEMON_SET) && - data.some( - (item) => item.kind.toLowerCase() === K8SSourceTypes.DAEMON_SET - ), - disabled: - (groupKinds.length === 1 && - groupKinds.includes(K8SSourceTypes.DAEMON_SET)) || - data.every( - (item) => item.kind.toLowerCase() !== K8SSourceTypes.DAEMON_SET - ), - }, - ], - }, - { - label: 'Namespaces', - subTitle: 'Display', - items: namespacesItems, - condition: true, - }, - { - label: 'Sort by', - subTitle: 'Sort by', - items: [ - { - label: 'Kind', - onClick: () => onSortClick(SourceSortOptions.KIND), - id: SourceSortOptions.KIND, - selected: currentSortId === SourceSortOptions.KIND, - }, - { - label: 'Language', - onClick: () => onSortClick(SourceSortOptions.LANGUAGE), - id: SourceSortOptions.LANGUAGE, - selected: currentSortId === SourceSortOptions.LANGUAGE, - }, - { - label: 'Name', - onClick: () => onSortClick(SourceSortOptions.NAME), - id: SourceSortOptions.NAME, - selected: currentSortId === SourceSortOptions.NAME, - }, - { - label: 'Namespace', - onClick: () => onSortClick(SourceSortOptions.NAMESPACE), - id: SourceSortOptions.NAMESPACE, - selected: currentSortId === SourceSortOptions.NAMESPACE, - }, - ], - condition: true, - }, - ]; - - if (showSourcesWithIssues) { - actionsGroup.unshift({ - label: 'Error', - subTitle: 'Filter by error message', - condition: true, - items: groupErrorMessages().map((item) => ({ - label: item, - onClick: () => onErrorClick(item), - id: item, - selected: groupErrorMessage.includes(item), - disabled: - groupErrorMessage.length === 1 && groupErrorMessage.includes(item), - })), - }); - } - - return actionsGroup; - }, [namespaces, groupNamespaces, data]); - - return ( - - - 0 - } - onChange={() => onSelectedCheckboxChange(SELECT_ALL_CHECKBOX)} - /> - - - {`${data.length} ${OVERVIEW.MENU.SOURCES}`} - - - {groupErrorMessage.length > 0 && ( - - setShowSourcesWithIssues(!showSourcesWithIssues) - } - label={'Show Sources with Errors'} - /> - )} - {selectedCheckbox.length > 0 && ( - - )} - - - - - - ); -} diff --git a/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.row.tsx b/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.row.tsx deleted file mode 100644 index 9f4d60637..000000000 --- a/frontend/webapp/components/overview/sources/managed.sources.table/sources.table.row.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import React from 'react'; -import theme from '@/styles/palette'; -import { ManagedSource } from '@/types'; -import { Container, Namespace } from '@/assets'; -import styled, { css } from 'styled-components'; -import { - KeyvalCheckbox, - KeyvalImage, - KeyvalLoader, - KeyvalTag, - KeyvalText, -} from '@/design.system'; -import { KIND_COLORS } from '@/styles/global'; -import { - LANGUAGES_COLORS, - LANGUAGES_LOGOS, - getMainContainerLanguage, -} from '@/utils'; -import { ConditionCheck } from '@/components/common'; - -const StyledTr = styled.tr` - &:hover { - background-color: ${theme.colors.light_dark}; - } -`; - -const StyledTd = styled.td<{ isFirstRow?: boolean }>` - padding: 10px 20px; - border-top: 1px solid ${theme.colors.blue_grey}; - - ${({ isFirstRow }) => - isFirstRow && - css` - border-top: none; - `} -`; - -const StyledMainTd = styled(StyledTd)` - cursor: pointer; - padding: 10px 20px; - display: flex; - gap: 20px; -`; - -const SourceIconContainer = styled.div` - display: flex; - align-items: center; - gap: 8px; -`; - -const SourceDetails = styled.div` - display: flex; - flex-direction: column; - gap: 4px; -`; - -const NameContainer = styled.div` - display: flex; - gap: 10px; - align-items: center; -`; - -const FooterContainer = styled.div` - display: flex; - gap: 16px; - align-items: center; -`; - -const FooterItemWrapper = styled.div` - display: flex; - align-items: center; - gap: 4px; -`; - -const StatusIndicator = styled.div<{ color: string }>` - width: 6px; - height: 6px; - border-radius: 4px; - background-color: ${({ color }) => color}; -`; - -const TagWrapper = styled.div` - padding: 0 20px; - width: 300px; - display: flex; - align-items: center; -`; - -const LOGO_STYLE: React.CSSProperties = { - padding: 4, - backgroundColor: theme.colors.white, -}; - -function getFirstNonIgnoredContainerName( - managedSource: ManagedSource -): string | null { - if (!managedSource?.instrumented_application_details?.languages) { - return null; - } - - const nonIgnoredLanguage = - managedSource?.instrumented_application_details?.languages.find( - (language) => language.language !== 'ignore' - ); - - return nonIgnoredLanguage ? nonIgnoredLanguage.container_name : null; -} - -const DEPLOYMENT = 'deployment'; -export function SourcesTableRow({ - item, - index, - selectedCheckbox, - onSelectedCheckboxChange, - onRowClick, -}: { - item: ManagedSource; - index: number; - data: ManagedSource[]; - selectedCheckbox: string[]; - onSelectedCheckboxChange: (id: string) => void; - onRowClick: (source: ManagedSource) => void; -}) { - const workloadProgrammingLanguage = getMainContainerLanguage(item); - - const containerName = getFirstNonIgnoredContainerName(item) || ''; - - function getLanguageStatus() { - if (workloadProgrammingLanguage === 'processing') { - return ( - <> - - - {'detecting language'} - - - ); - } - - return ( - <> - - - {workloadProgrammingLanguage} - - - ); - } - - return ( - - - onSelectedCheckboxChange(JSON.stringify(item))} - /> - onRowClick(item)}> -
- -
- onRowClick(item)}> - - - {`${item.name || 'Source'} `} - - - - - - - {getLanguageStatus()} - - - - {item.namespace} - - - - - - {containerName} - - - - - - - - -
-
-
- ); -} diff --git a/frontend/webapp/components/setup/connection/connections_icons/connections_icons.tsx b/frontend/webapp/components/setup/connection/connections_icons/connections_icons.tsx deleted file mode 100644 index 9b0f262b3..000000000 --- a/frontend/webapp/components/setup/connection/connections_icons/connections_icons.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import styled from 'styled-components'; -import { KeyvalImage } from '@/design.system'; -import { ConnectIcon } from '@keyval-dev/design-system'; - -const ConnectionsIconsWrapper = styled.div` - display: flex; - align-items: center; -`; - -const Divider = styled.div` - width: 16px; - height: 8.396px; - background: radial-gradient( - 78.09% 72.18% at 100% -0%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), - linear-gradient(180deg, #2e4c55 0%, #303355 100%); -`; - -const IMAGE_STYLE: React.CSSProperties = { - backgroundColor: '#fff', - padding: 4, -}; - -export function ConnectionsIcons({ - icon, - imageStyle, -}: { - icon: string; - imageStyle?: React.CSSProperties; -}) { - return icon ? ( - - - - - - ) : null; -} diff --git a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.styled.tsx b/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.styled.tsx deleted file mode 100644 index a939437a8..000000000 --- a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.styled.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import styled from 'styled-components'; - -export const CheckboxWrapper = styled.div` - gap: 14px; - display: flex; -`; - -export const ConnectionMonitorsWrapper = styled.div` - gap: 16px; - display: flex; - margin-top: 32px; - flex-direction: column; -`; - -export const FieldWrapper = styled.div` - margin-top: 22px; - width: 348px; -`; - -export const CreateDestinationButtonWrapper = styled.div` - margin-top: 48px; - gap: 16px; - width: 362px; - display: flex; - flex-direction: column; -`; diff --git a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx b/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx deleted file mode 100644 index e047df7cd..000000000 --- a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx +++ /dev/null @@ -1,288 +0,0 @@ -'use client'; -import React, { useState, useEffect } from 'react'; -import theme from '@/styles/palette'; -import { useCheckConnection, useKeyDown } from '@/hooks'; -import { Field, SelectedDestination } from '@/types'; -import { renderFields } from './dynamic.fields'; -import { - cleanObjectEmptyStringsValues, - SETUP, - stringifyNonStringValues, -} from '@/utils'; -import { DestinationBody } from '@/containers/setup/connection/connection.section'; -import { - KeyvalButton, - KeyvalCheckbox, - KeyvalInput, - KeyvalLoader, - KeyvalText, -} from '@/design.system'; -import { - CheckboxWrapper, - ConnectionMonitorsWrapper, - FieldWrapper, - CreateDestinationButtonWrapper, -} from './create.connection.form.styled'; - -interface CreateConnectionFormProps { - fields: Field[]; - destination: SelectedDestination; - onSubmit: (formData: DestinationBody) => void; - dynamicFieldsValues?: { - [key: string]: any; - }; - destinationNameValue?: string | null; - checkboxValues?: { - [key: string]: boolean; - }; -} - -const MONITORS = [ - { id: 'logs', label: SETUP.MONITORS.LOGS, checked: true }, - { id: 'metrics', label: SETUP.MONITORS.METRICS, checked: true }, - { id: 'traces', label: SETUP.MONITORS.TRACES, checked: true }, -]; - -// fields are the current destination supported fields which we want to have. -// fieldValues read the actual values that are received from the cluster. -// if there are field values which are not part of the current schema, we want to remove them. -const sanitizeDynamicFields = ( - fields: Field[], - fieldValues: Record | undefined -): Record => { - if (!fieldValues) { - return {}; - } - return Object.fromEntries( - Object.entries(fieldValues).filter(([key, value]) => - fields.find((field) => field.name === key) - ) - ); -}; - -export function CreateConnectionForm({ - fields, - onSubmit, - destination, - dynamicFieldsValues, - destinationNameValue, - checkboxValues, -}: CreateConnectionFormProps) { - const [selectedMonitors, setSelectedMonitors] = useState(MONITORS); - const [isCreateButtonDisabled, setIsCreateButtonDisabled] = useState(true); - const [isConnectionTested, setIsConnectionTested] = useState({ - enabled: null, - message: '', - }); - const [dynamicFields, setDynamicFields] = useState( - sanitizeDynamicFields(fields, dynamicFieldsValues) - ); - const [destinationName, setDestinationName] = useState( - destinationNameValue || '' - ); - - const { checkDestinationConnection, isLoading } = useCheckConnection(); - - useEffect(() => { - setInitialDynamicFields(); - }, [fields]); - - useEffect(() => { - isFormValid(); - }, [destinationName, dynamicFields]); - - useEffect(() => { - filterSupportedMonitors(); - }, [destination]); - - useKeyDown('Enter', handleKeyPress); - - function handleKeyPress(e: any) { - if (!isCreateButtonDisabled) { - onCreateClick(); - } - } - - function setInitialDynamicFields() { - if (fields) { - const defaultValues = fields.reduce( - (acc: { [key: string]: string }, field: Field) => { - const value = dynamicFields[field.name] || field.initial_value || ''; - acc[field.name] = value; - return acc; - }, - {} as { [key: string]: string } - ); - setDynamicFields(defaultValues); - } - } - - function filterSupportedMonitors() { - const data: any = !checkboxValues - ? MONITORS - : MONITORS.map((monitor) => ({ - ...monitor, - checked: checkboxValues[monitor.id], - })); - - setSelectedMonitors( - data.filter(({ id }) => destination?.supported_signals?.[id]?.supported) - ); - } - - const handleCheckboxChange = (id: string) => { - setSelectedMonitors((prevSelectedMonitors) => { - const totalSelected = prevSelectedMonitors.filter( - ({ checked }) => checked - ).length; - - if ( - totalSelected === 1 && - prevSelectedMonitors.find((item) => item.id === id)?.checked - ) { - return prevSelectedMonitors; // Prevent unchecking the last selected checkbox - } - - const updatedMonitors = prevSelectedMonitors.map((checkbox) => - checkbox.id === id - ? { ...checkbox, checked: !checkbox.checked } - : checkbox - ); - - return updatedMonitors; - }); - }; - - function handleDynamicFieldChange(name: string, value: string) { - if (isConnectionTested.enabled !== null) { - setIsConnectionTested({ enabled: null, message: '' }); - } - - setDynamicFields((prevFields) => ({ ...prevFields, [name]: value })); - } - - function isFormValid() { - let isValid = true; - for (let field of fields) { - if (field.component_properties.required) { - const value = dynamicFields[field.name]; - if (value === undefined || value.trim() === '' || !destinationName) { - isValid = false; - break; - } - } - } - setIsCreateButtonDisabled(!isValid); - } - - function onCreateClick() { - const signals = selectedMonitors.reduce( - (acc, { id, checked }) => ({ ...acc, [id]: checked }), - {} - ); - - const stringifyFields = stringifyNonStringValues(dynamicFields); - const fields = cleanObjectEmptyStringsValues(stringifyFields); - - const body = { - name: destinationName, - signals, - fields, - type: destination.type, - }; - onSubmit(body); - } - - async function handleCheckDestinationConnection() { - const signals = selectedMonitors.reduce( - (acc, { id, checked }) => ({ ...acc, [id]: checked }), - {} - ); - - const stringifyFields = stringifyNonStringValues(dynamicFields); - const fields = cleanObjectEmptyStringsValues(stringifyFields); - - const body = { - name: destinationName, - signals, - fields, - type: destination.type, - }; - try { - checkDestinationConnection(body, setIsConnectionTested); - } catch (error) {} - } - - return ( - <> - - {dynamicFieldsValues - ? SETUP.UPDATE_CONNECTION - : SETUP.CREATE_CONNECTION} - - {selectedMonitors?.length >= 1 && ( - - {SETUP.CONNECTION_MONITORS} - - {selectedMonitors.map((checkbox) => ( - handleCheckboxChange(checkbox?.id)} - label={checkbox?.label} - /> - ))} - - - )} - - - - {renderFields(fields, dynamicFields, handleDynamicFieldChange)} - - {destination?.test_connection_supported && ( - - {isLoading ? ( - - ) : isConnectionTested.enabled === null ? ( - - {'Test Connection'} - - ) : isConnectionTested.enabled ? ( - - {'Connection Successful'} - - ) : ( - - {isConnectionTested.message} - - )} - - )} - - - {dynamicFieldsValues - ? SETUP.UPDATE_DESTINATION - : SETUP.CREATE_DESTINATION} - - - - - ); -} diff --git a/frontend/webapp/components/setup/connection/create.connection.form/dynamic.fields.tsx b/frontend/webapp/components/setup/connection/create.connection.form/dynamic.fields.tsx deleted file mode 100644 index 1104dec5e..000000000 --- a/frontend/webapp/components/setup/connection/create.connection.form/dynamic.fields.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import React from 'react'; -import { Field } from '@/types/destinations'; -import { KeyValue } from '@keyval-dev/design-system'; -import { INPUT_TYPES } from '@/utils/constants/string'; -import { safeJsonParse } from '@/utils/functions/strings'; -import { FieldWrapper } from './create.connection.form.styled'; -import { - KeyvalDropDown, - KeyvalInput, - KeyValuePair, - MultiInputTable, - TextArea, -} from '@/design.system'; - -const DEFAULT_KEY_VALUE_PAIR = {}; -export function renderFields( - fields: Field[], - dynamicFields: object, - onChange: (name: string, value: any) => void -) { - return fields?.map((field) => { - const { name, component_type, display_name, component_properties } = field; - - switch (component_type) { - case INPUT_TYPES.INPUT: - return ( - - onChange(name, value)} - {...component_properties} - /> - - ); - case INPUT_TYPES.DROPDOWN: - const dropdownData = component_properties?.values.map( - (value: string) => ({ - label: value, - id: value, - }) - ); - - const dropDownValue = dynamicFields[name] - ? { id: dynamicFields[name], label: dynamicFields[name] } - : null; - - return ( - - onChange(name, label)} - value={dropDownValue} - {...component_properties} - /> - - ); - case INPUT_TYPES.MULTI_INPUT: - let values = dynamicFields[name] || field.initial_value; - if (typeof values === 'string') { - values = safeJsonParse(values, []); - } - return ( -
- - onChange(name, value.length === 0 ? [] : value) - } - {...component_properties} - /> -
- ); - - case INPUT_TYPES.KEY_VALUE_PAIR: - let keyValues = dynamicFields[name] || DEFAULT_KEY_VALUE_PAIR; - if (typeof keyValues === 'string') { - keyValues = safeJsonParse<{ [key: string]: string }>(keyValues, {}); - } - - keyValues = Object.keys(keyValues).map((key) => ({ - key, - value: keyValues[key], - })); - - const array: KeyValue[] = []; - let id = 0; - for (const item of keyValues) { - const { key, value } = item; - array.push({ id: id++, key: key, value: value as string }); - } - keyValues = array; - - return ( -
- { - const data = value - .map((item) => { - return { key: item.key, value: item.value }; - }) - .reduce((obj, item) => { - obj[item.key] = item.value; - return obj; - }, {}); - onChange(name, data); - }} - keyValues={keyValues} - {...component_properties} - /> -
- ); - case INPUT_TYPES.TEXTAREA: - return ( - -